summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/shift.ll
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-10-04 22:16:22 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-10-04 22:16:22 +0000
commitfb5af8b9b93cb270fda7832e24cab9cb62dec16f (patch)
treea339bff1c5a427fddaf3ac2f873607087f7e61a6 /llvm/test/Transforms/InstCombine/shift.ll
parentf304d4d185d24eec9f0ca84d566da0d51b2344ef (diff)
downloadbcm5719-llvm-fb5af8b9b93cb270fda7832e24cab9cb62dec16f.tar.gz
bcm5719-llvm-fb5af8b9b93cb270fda7832e24cab9cb62dec16f.zip
[InstCombine] Fold 'icmp eq/ne (?trunc (lshr/ashr %x, bitwidth(x)-1)), 0' -> 'icmp sge/slt %x, 0'
We do indeed already get it right in some cases, but only transitively, with one-use restrictions. Since we only need to produce a single comparison, it makes sense to match the pattern directly: https://rise4fun.com/Alive/kPg llvm-svn: 373802
Diffstat (limited to 'llvm/test/Transforms/InstCombine/shift.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/shift.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll
index 501f015ed73..9ded69ad7b9 100644
--- a/llvm/test/Transforms/InstCombine/shift.ll
+++ b/llvm/test/Transforms/InstCombine/shift.ll
@@ -428,8 +428,8 @@ define i8 @test28a(i8 %x, i8 %y) {
; CHECK-LABEL: @test28a(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP1:%.*]] = lshr i8 [[X:%.*]], 7
-; CHECK-NEXT: [[COND1:%.*]] = icmp eq i8 [[TMP1]], 0
-; CHECK-NEXT: br i1 [[COND1]], label [[BB2:%.*]], label [[BB1:%.*]]
+; CHECK-NEXT: [[COND1:%.*]] = icmp slt i8 [[X]], 0
+; CHECK-NEXT: br i1 [[COND1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: ret i8 [[TMP1]]
; CHECK: bb2:
OpenPOWER on IntegriCloud