[llvm] r271856 - Add test case for InstCombiner::commonIRemTransforms; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 5 14:17:00 PDT 2016
Author: sanjoy
Date: Sun Jun 5 16:17:00 2016
New Revision: 271856
URL: http://llvm.org/viewvc/llvm-project?rev=271856&view=rev
Log:
Add test case for InstCombiner::commonIRemTransforms; NFC
The PHI case in commonIRemTransforms was untested; add a trivial test
case.
Modified:
llvm/trunk/test/Transforms/InstCombine/rem.ll
Modified: llvm/trunk/test/Transforms/InstCombine/rem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/rem.ll?rev=271856&r1=271855&r2=271856&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/rem.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/rem.ll Sun Jun 5 16:17:00 2016
@@ -231,3 +231,26 @@ define <2 x i64> @test20(<2 x i64> %X, <
%R = urem <2 x i64> %V, <i64 2, i64 3>
ret <2 x i64> %R
}
+
+define i32 @test21(i1 %c0, i32* %val) {
+; CHECK-LABEL: @test21(
+entry:
+ br i1 %c0, label %if.then, label %if.end
+
+if.then:
+; CHECK: if.then:
+; CHECK-NEXT: %v = load volatile i32, i32* %val, align 4
+; CHECK-NEXT: %phitmp = srem i32 %v, 5
+
+ %v = load volatile i32, i32* %val
+ br label %if.end
+
+if.end:
+; CHECK: if.end:
+; CHECK-NEXT: %lhs = phi i32 [ %phitmp, %if.then ], [ 0, %entry ]
+; CHECK-NEXT: ret i32 %lhs
+
+ %lhs = phi i32 [ %v, %if.then ], [ 5, %entry ]
+ %rem = srem i32 %lhs, 5
+ ret i32 %rem
+}
More information about the llvm-commits
mailing list