diff options
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r-- | lib/Transforms/Scalar/Reassociate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index fb143c9827..142ede38e1 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -612,6 +612,12 @@ void Reassociate::ReassociateBB(BasicBlock *BB) { if (I->hasOneUse() && isReassociableOp(I->use_back(), I->getOpcode())) continue; + // If this is an add tree that is used by a sub instruction, ignore it + // until we process the subtract. + if (I->hasOneUse() && I->getOpcode() == Instruction::Add && + cast<Instruction>(I->use_back())->getOpcode() == Instruction::Sub) + continue; + // First, walk the expression tree, linearizing the tree, collecting std::vector<ValueEntry> Ops; LinearizeExprTree(I, Ops); |