[PATCH] D18905: [ValueTracking] Improve isImpliedCondition for conditions with matching operands.
Chad Rosier via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 18 16:03:50 PDT 2016
mcrosier marked 5 inline comments as done.
================
Comment at: lib/Analysis/ValueTracking.cpp:3834
@@ +3833,3 @@
+ CmpInst::Predicate UnsignedBPred = ICmpInst::getUnsignedPredicate(BPred);
+ switch (UnsignedAPred) {
+ default:
----------------
sanjoy wrote:
> This does not need to happen in this change, but it really looks like this logic is general enough to live in `CmpInst` along with things like `isTrueWhenEqual` as `CmpInst::isImpliedPredicate`.
I'll need to investigate. Thanks for the suggestion, Sanjoy.
================
Comment at: lib/Analysis/ValueTracking.cpp:3900-3903
@@ -3799,3 +3899,6 @@
// LHS ==> RHS by definition
- if (LHS == RHS) return true;
+ if (LHS == RHS) {
+ ImpliedTrue = true;
+ return true;
+ }
----------------
sanjoy wrote:
> This is why I'd have liked an `Optional<bool>` return value. :) Avoids mistakes like these.
:/ I'll address this in a follow up commit.
http://reviews.llvm.org/D18905
More information about the llvm-commits
mailing list