diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-13 07:41:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-13 07:41:29 +0000 |
commit | 79db357d801602962f41eac0769f15d789cc1c80 (patch) | |
tree | 8cda89535ac8a31465db1afb915aaa41c6649967 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 7a6d2e9ca1284bed62fc681faa6e980633e6aef2 (diff) | |
download | bcm5719-llvm-79db357d801602962f41eac0769f15d789cc1c80.tar.gz bcm5719-llvm-79db357d801602962f41eac0769f15d789cc1c80.zip |
Completely disable the optimization I added in r121680 until
I can track down a miscompile. This should bring the buildbots
back to life
llvm-svn: 121693
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 18c2905a546..d7a6ea4655a 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -331,8 +331,8 @@ GatherConstantCompares(Value *V, std::vector<ConstantInt*> &Vals, Value *&Extra, isEQ)) { if (LHS == RHS) return LHS; + Vals.resize(NumVals); } - Vals.resize(NumVals); // The RHS of the or/and can't be folded in and we haven't used "Extra" yet, // set it and return success. @@ -348,12 +348,13 @@ GatherConstantCompares(Value *V, std::vector<ConstantInt*> &Vals, Value *&Extra, // If the LHS can't be folded in, but Extra is available and RHS can, try to // use LHS as Extra. if (Extra == 0 || Extra == I->getOperand(0)) { + Value *OldExtra = Extra; Extra = I->getOperand(0); if (Value *RHS = GatherConstantCompares(I->getOperand(1), Vals, Extra, TD, isEQ)) return RHS; - Vals.resize(NumValsBeforeLHS); - Extra = 0; + assert(Vals.size() == NumValsBeforeLHS); + Extra = OldExtra; } return 0; @@ -1908,6 +1909,8 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) { // then we evaluate them with an explicit branch first. Split the block // right before the condbr to handle it. if (ExtraCase) { + return false; + BasicBlock *NewBB = BB->splitBasicBlock(BI, "switch.early.test"); // Remove the uncond branch added to the old block. TerminatorInst *OldTI = BB->getTerminator(); |