summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-05-19 19:41:11 +0000
committerDavide Italiano <davide@freebsd.org>2017-05-19 19:41:11 +0000
commit7dc2efbce4a8e0968646fc7fbbeda326c326645f (patch)
treeb21b45f99b60ca7265d06a4d9a82b50c586a49a3 /llvm/test/Transforms/InstCombine
parent526f4f2aa8d810d9cffafda56d4a16d0fc5a8dda (diff)
downloadbcm5719-llvm-7dc2efbce4a8e0968646fc7fbbeda326c326645f.tar.gz
bcm5719-llvm-7dc2efbce4a8e0968646fc7fbbeda326c326645f.zip
[InstCombine] *Actually* commit the test showing the miscompile.
Clarify a comment while I'm here. llvm-svn: 303447
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/cast.ll14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/cast.ll b/llvm/test/Transforms/InstCombine/cast.ll
index 74ea67ac72b..2f15617e065 100644
--- a/llvm/test/Transforms/InstCombine/cast.ll
+++ b/llvm/test/Transforms/InstCombine/cast.ll
@@ -1471,7 +1471,7 @@ define i32 @test93(i32 %A) {
ret i32 %D
}
-; The following three tests show a miscompile of sext + lshr + trunc patterns.
+; The following four tests sext + lshr + trunc patterns.
; PR33078
define i8 @pr33078_1(i8 %A) {
@@ -1509,3 +1509,15 @@ define i4 @pr33078_3(i8 %A) {
%D = trunc i16 %C to i4
ret i4 %D
}
+
+define i8 @pr33078_4(i3 %x) {
+; Don't turn this in an `ashr`. This was getting miscompiled
+; CHECK-LABEL: @pr33078_4(
+; CHECK-NEXT: [[C:%.*]] = ashr i3 %x, 2
+; CHECK-NEXT: [[B:%.*]] = sext i3 [[C]] to i8
+; CHECK-NEXT: ret i8 [[D]]
+ %B = sext i3 %x to i16
+ %C = lshr i16 %B, 13
+ %D = trunc i16 %C to i8
+ ret i8 %D
+}
OpenPOWER on IntegriCloud