1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Add test case for InstCombiner::commonIRemTransforms; NFC

The PHI case in commonIRemTransforms was untested; add a trivial test
case.

llvm-svn: 271856
This commit is contained in:
Sanjoy Das 2016-06-05 21:17:00 +00:00
parent d8092c740d
commit feb879a718

View File

@ -231,3 +231,26 @@ define <2 x i64> @test20(<2 x i64> %X, <2 x i1> %C) {
%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
}