[PATCH] D19330: Refactor implied condition logic from ValueTracking directly into CmpInst. NFC.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 22:54:43 PDT 2016


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

Given that this passes all the checked in tests then I'm okay signing off on this for now (with a FIXME stating what remains to be done); but depending on how much time you're willing to commit here, I think we can make this code more comprehensive.  I've added a comment inline about some of the missing cases, but there is a useful litmus test here:  we should be able to implement `isFalseWhenOperandsMatch(X, Y)` exactly as `isTrueWhenOperandsMatch(X, getInversePredicate(Y))`.  Any situation where that doesn't work is a missing case.


================
Comment at: lib/IR/Instructions.cpp:3609
@@ +3608,3 @@
+    break;
+  case ICMP_UGT: // A >u B implies A != B is true.
+  case ICMP_ULT: // A <u B implies A != B is true.
----------------
`UGT` also implies `UGE` etc. 

`EQ` will imply all `UGE`, `SLE` etc. variants.


http://reviews.llvm.org/D19330





More information about the llvm-commits mailing list