diff options
| author | David Green <david.green@arm.com> | 2018-10-11 11:28:27 +0000 |
|---|---|---|
| committer | David Green <david.green@arm.com> | 2018-10-11 11:28:27 +0000 |
| commit | 8066198442da16027a646c56d3c87ca0ba3fcb86 (patch) | |
| tree | 15e754c1be196cf5135e43c132b35f6195c1b444 /llvm/test | |
| parent | 686ef9214147c048514f579b128bdbd9bbb49504 (diff) | |
| download | bcm5719-llvm-8066198442da16027a646c56d3c87ca0ba3fcb86.tar.gz bcm5719-llvm-8066198442da16027a646c56d3c87ca0ba3fcb86.zip | |
[InstCombine] Demand bits of UMin
This is the umin alternative to the umax code from rL344237. We use
DeMorgans law on the umax case to bring us to the same thing on umin,
but using countLeadingOnes, not countLeadingZeros.
Differential Revision: https://reviews.llvm.org/D53036
llvm-svn: 344239
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/minmax-demandbits.ll | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/test/Transforms/InstCombine/minmax-demandbits.ll b/llvm/test/Transforms/InstCombine/minmax-demandbits.ll index f838560f965..29a569663d2 100644 --- a/llvm/test/Transforms/InstCombine/minmax-demandbits.ll +++ b/llvm/test/Transforms/InstCombine/minmax-demandbits.ll @@ -190,9 +190,7 @@ define i32 @or_umin(i32 %A) { define i8 @or_min_31_30(i8 %A) { ; CHECK-LABEL: @or_min_31_30( -; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[A:%.*]], -30 -; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP]], i8 [[A]], i8 -30 -; CHECK-NEXT: [[R:%.*]] = or i8 [[MIN]], 31 +; CHECK-NEXT: [[R:%.*]] = or i8 [[A:%.*]], 31 ; CHECK-NEXT: ret i8 [[R]] ; %cmp = icmp ult i8 %A, -30 @@ -203,9 +201,7 @@ define i8 @or_min_31_30(i8 %A) { define i8 @and_min_7_7(i8 %A) { ; CHECK-LABEL: @and_min_7_7( -; CHECK-NEXT: [[L2:%.*]] = icmp ult i8 [[A:%.*]], -7 -; CHECK-NEXT: [[MIN:%.*]] = select i1 [[L2]], i8 [[A]], i8 -7 -; CHECK-NEXT: [[R:%.*]] = and i8 [[MIN]], -8 +; CHECK-NEXT: [[R:%.*]] = and i8 [[A:%.*]], -8 ; CHECK-NEXT: ret i8 [[R]] ; %l2 = icmp ult i8 %A, -7 @@ -216,9 +212,7 @@ define i8 @and_min_7_7(i8 %A) { define i8 @and_min_7_8(i8 %A) { ; CHECK-LABEL: @and_min_7_8( -; CHECK-NEXT: [[L2:%.*]] = icmp ult i8 [[A:%.*]], -8 -; CHECK-NEXT: [[MIN:%.*]] = select i1 [[L2]], i8 [[A]], i8 -8 -; CHECK-NEXT: [[R:%.*]] = and i8 [[MIN]], -8 +; CHECK-NEXT: [[R:%.*]] = and i8 [[A:%.*]], -8 ; CHECK-NEXT: ret i8 [[R]] ; %l2 = icmp ult i8 %A, -8 |

