[llvm] r313161 - [InstSimplify] regenerate checks; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 13 10:39:40 PDT 2017
Author: spatel
Date: Wed Sep 13 10:39:39 2017
New Revision: 313161
URL: http://llvm.org/viewvc/llvm-project?rev=313161&view=rev
Log:
[InstSimplify] regenerate checks; NFC
Modified:
llvm/trunk/test/Transforms/InstSimplify/exact-nsw-nuw.ll
Modified: llvm/trunk/test/Transforms/InstSimplify/exact-nsw-nuw.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/exact-nsw-nuw.ll?rev=313161&r1=313160&r2=313161&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/exact-nsw-nuw.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/exact-nsw-nuw.ll Wed Sep 13 10:39:39 2017
@@ -2,59 +2,70 @@
; PR8862
-; CHECK-LABEL: @shift1(
-; CHECK: ret i32 %A
define i32 @shift1(i32 %A, i32 %B) {
+; CHECK-LABEL: @shift1(
+; CHECK-NEXT: ret i32 %A
+;
%C = lshr exact i32 %A, %B
%D = shl nuw i32 %C, %B
ret i32 %D
}
-; CHECK-LABEL: @shift2(
-; CHECK: lshr
-; CHECK: ret i32 %D
define i32 @shift2(i32 %A, i32 %B) {
+; CHECK-LABEL: @shift2(
+; CHECK-NEXT: [[C:%.*]] = lshr i32 %A, %B
+; CHECK-NEXT: [[D:%.*]] = shl nuw i32 [[C]], %B
+; CHECK-NEXT: ret i32 [[D]]
+;
%C = lshr i32 %A, %B
%D = shl nuw i32 %C, %B
ret i32 %D
}
-; CHECK-LABEL: @shift3(
-; CHECK: ret i32 %A
define i32 @shift3(i32 %A, i32 %B) {
+; CHECK-LABEL: @shift3(
+; CHECK-NEXT: ret i32 %A
+;
%C = ashr exact i32 %A, %B
%D = shl nuw i32 %C, %B
ret i32 %D
}
-; CHECK-LABEL: @shift4(
-; CHECK: ret i32 %A
define i32 @shift4(i32 %A, i32 %B) {
+; CHECK-LABEL: @shift4(
+; CHECK-NEXT: ret i32 %A
+;
%C = shl nuw i32 %A, %B
%D = lshr i32 %C, %B
ret i32 %D
}
-; CHECK-LABEL: @shift5(
-; CHECK: ret i32 %A
define i32 @shift5(i32 %A, i32 %B) {
+; CHECK-LABEL: @shift5(
+; CHECK-NEXT: ret i32 %A
+;
%C = shl nsw i32 %A, %B
%D = ashr i32 %C, %B
ret i32 %D
}
-; CHECK-LABEL: @div1(
-; CHECK: ret i32 0
define i32 @div1(i32 %V) {
+; CHECK-LABEL: @div1(
+; CHECK-NEXT: ret i32 0
+;
%A = udiv i32 %V, -2147483648
%B = udiv i32 %A, -2147483648
ret i32 %B
}
-; CHECK-LABEL: @div2(
-; CHECK-NOT: ret i32 0
define i32 @div2(i32 %V) {
+; CHECK-LABEL: @div2(
+; CHECK-NEXT: [[A:%.*]] = sdiv i32 %V, -1
+; CHECK-NEXT: [[B:%.*]] = sdiv i32 [[A]], -2147483648
+; CHECK-NEXT: ret i32 [[B]]
+;
%A = sdiv i32 %V, -1
%B = sdiv i32 %A, -2147483648
ret i32 %B
}
+
More information about the llvm-commits
mailing list