[PATCH] D62818: [InstCombine] Introduce fold for icmp pred (and X, (sh signbit, Y)), 0.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 02:49:28 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:1785-1786
 
+  // (V0 & (signbit l>> V1)) ==/!= 0 -> (V0 << V1) >=/< 0
+  // (V0 & (signbit << V1)) ==/!= 0 -> (V0 l>> V1) >=/< 0
+  Value *V0, *V1, *Shift;
----------------
```
  // (V0 & (signbit l>> V1)) ==/!= 0 -> (V0 << V1) s>=/s< 0
  // (V0 & (signbit << V1)) ==/!= 0 -> (V0 l>> V1) s>=/s< 0
```


================
Comment at: llvm/test/Transforms/InstCombine/onehot_merge.ll:18
 ;CHECK: @foo1_and
-;CHECK:  shl i32 1, %c1
-;CHECK-NEXT:  lshr i32 -2147483648, %c2
----------------
lebedev.ri wrote:
> lebedev.ri wrote:
> > Can you please regenerate the original test?
> I'm not sure what's on the LHS of the diff, but ignoring the instruction count this looks like improvement to me.
AH, you also want to str-replace `%tmp` with `%t`, it confuses the update script likely.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62818





More information about the llvm-commits mailing list