[llvm] r303447 - [InstCombine] *Actually* commit the test showing the miscompile.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 12:41:11 PDT 2017


Author: davide
Date: Fri May 19 14:41:11 2017
New Revision: 303447

URL: http://llvm.org/viewvc/llvm-project?rev=303447&view=rev
Log:
[InstCombine] *Actually* commit the test showing the miscompile.

Clarify a comment while I'm here.

Modified:
    llvm/trunk/test/Transforms/InstCombine/cast.ll

Modified: llvm/trunk/test/Transforms/InstCombine/cast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/cast.ll?rev=303447&r1=303446&r2=303447&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/cast.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/cast.ll Fri May 19 14:41:11 2017
@@ -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
+}




More information about the llvm-commits mailing list