[PATCH] D63675: [InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp eq/ne (and %x, (lshr -C1, C2)), 0.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 22 03:48:18 PDT 2019
- Previous message: [PATCH] D63675: [InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp eq/ne (and %x, (lshr -C1, C2)), 0.
- Next message: [PATCH] D63675: [InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp eq/ne (and %x, (lshr -C1, C2)), 0.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
lebedev.ri added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/shl-and-unsigned-cmp-const.ll:15-25
define i1 @scalar_i8_shl_and_ult_const_1(i8 %x) {
; CHECK-LABEL: @scalar_i8_shl_and_ult_const_1(
-; CHECK-NEXT: [[SHL:%.*]] = shl i8 [[X:%.*]], 5
-; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[SHL]], 64
+; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X:%.*]], 6
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[TMP1]], 0
; CHECK-NEXT: ret i1 [[CMP]]
;
%shl = shl i8 %x, 5
----------------
Why is this test so complicated?
```
%shl = shl i8 %x, 5
%cmp = icmp ult i8 %shl, 64
```
seems sufficient?
https://godbolt.org/z/GcVzPz
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63675/new/
https://reviews.llvm.org/D63675
- Previous message: [PATCH] D63675: [InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp eq/ne (and %x, (lshr -C1, C2)), 0.
- Next message: [PATCH] D63675: [InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp eq/ne (and %x, (lshr -C1, C2)), 0.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the llvm-commits
mailing list