[PATCH] D63670: [InstCombine][NFC] Add test to show missing fold for icmp ult/uge (shl %x, C2), C1.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 15:08:40 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/shl-unsigned-cmp-const.ll:83-87
+; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i8 [[SHL]], 63
+; CHECK-NEXT:    ret i1 [[CMP]]
+;
+  %shl = shl i8 %x, 5
+  %cmp = icmp uge i8 %shl, 64
----------------
Yeah, it's not really possible to ensure that those folds happen, the predicate is canonicalized.
I'd recommend to add those tests with predicate variants using vectors: https://godbolt.org/z/69dzCf
^ Looks like those aren't being canonicalized, at least right now.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63670





More information about the llvm-commits mailing list