[PATCH] D89317: [InstructionSimplify] icmp simplification

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 10:32:11 PDT 2020


spatel added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2884
+  return (C1->slt(*C2) && C1->isNonNegative()) ||
+         (C2->slt(*C1) && C2->isNonPositive());
+}
----------------
I don't think this is the correct condition:
https://rise4fun.com/Alive/EeGe

Please add a test like this to verify:

```
define i1 @icmp_nsw_false(i8 %V) {
  %add = add i8 %V, 121
  %addnsw = add nsw i8 %V, -104
  %cmp = icmp slt i8 %add, %addnsw
  ret i1 %cmp
}

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89317/new/

https://reviews.llvm.org/D89317



More information about the llvm-commits mailing list