summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/NewGVN.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index 0cf9979b40a..94973c986e9 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -1585,11 +1585,11 @@ NewGVN::performSymbolicPredicateInfoEvaluation(Instruction *I) const {
SwappedOps ? Cmp->getSwappedPredicate() : Cmp->getPredicate();
if (isa<PredicateAssume>(PI)) {
- // If the comparison is true when the operands are equal, then we know the
- // operands are equal, because assumes must always be true.
- if (CmpInst::isTrueWhenEqual(Predicate)) {
+ // If we assume the operands are equal, then they are equal.
+ if (Predicate == CmpInst::ICMP_EQ) {
addPredicateUsers(PI, I);
- addAdditionalUsers(Cmp->getOperand(0), I);
+ addAdditionalUsers(SwappedOps ? Cmp->getOperand(1) : Cmp->getOperand(0),
+ I);
return createVariableOrConstant(FirstOp);
}
}
OpenPOWER on IntegriCloud