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 | 92407e589524d98080f4db943a0e2a3bf18ec8a2 (patch) | |
tree | 30ae4d84a9a2c990439268125e0935859da100ba /lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 11ae9e29a98595c1899047a64f621fbe46ce7015 (diff) |
Completely disable the optimization I added in r121680 until
I can track down a miscompile. This should bring the buildbots
back to life
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 18c2905a54..d7a6ea4655 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/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(); |