diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-09 17:18:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-09 17:18:49 +0000 |
commit | eddc65aa0da35ee906e27cc7a13f44260c70007c (patch) | |
tree | db512adeb64363e3fdda2aa683aa3d45cca25cd0 /lib/Analysis/PHITransAddr.cpp | |
parent | 990d2857654cb80e46d207533834be3047494830 (diff) |
fix PR5733, a case where we'd replace an add with a lexically identical
binary operator that wasn't an add. In this case, a xor. Whoops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PHITransAddr.cpp')
-rw-r--r-- | lib/Analysis/PHITransAddr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/PHITransAddr.cpp b/lib/Analysis/PHITransAddr.cpp index bea88326cc..a1b2afbaf7 100644 --- a/lib/Analysis/PHITransAddr.cpp +++ b/lib/Analysis/PHITransAddr.cpp @@ -280,7 +280,8 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB, for (Value::use_iterator UI = LHS->use_begin(), E = LHS->use_end(); UI != E; ++UI) { if (BinaryOperator *BO = dyn_cast<BinaryOperator>(*UI)) - if (BO->getOperand(0) == LHS && BO->getOperand(1) == RHS && + if (BO->getOpcode() == Instruction::Add && + BO->getOperand(0) == LHS && BO->getOperand(1) == RHS && BO->getParent()->getParent() == CurBB->getParent()) return BO; } |