mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
a62270de2c
The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
53 lines
1.2 KiB
LLVM
53 lines
1.2 KiB
LLVM
; RUN: opt < %s -simplifycfg -sink-common-insts -S | FileCheck %s
|
|
; RUN: opt < %s -passes='simplify-cfg<sink-common-insts>' -S | FileCheck %s
|
|
|
|
define i1 @test1(i1 zeroext %flag, i8* %y) #0 {
|
|
entry:
|
|
br i1 %flag, label %if.then, label %if.else
|
|
|
|
if.then:
|
|
%r = call i1 @llvm.type.test(i8* %y, metadata !0)
|
|
br label %if.end
|
|
|
|
if.else:
|
|
%s = call i1 @llvm.type.test(i8* %y, metadata !1)
|
|
br label %if.end
|
|
|
|
if.end:
|
|
%t = phi i1 [ %s, %if.else ], [ %r, %if.then ]
|
|
ret i1 %t
|
|
}
|
|
|
|
!0 = !{i32 0, !"typeid1"}
|
|
!1 = !{i32 4, !"typeid1"}
|
|
|
|
declare i1 @llvm.type.test(i8* %ptr, metadata %bitset) nounwind readnone
|
|
|
|
; CHECK-LABEL: test1
|
|
; CHECK: @llvm.type.test
|
|
; CHECK: @llvm.type.test
|
|
; CHECK: ret i1
|
|
|
|
define i1 @test2(i1 zeroext %flag, i8* %y, i8* %z) #0 {
|
|
entry:
|
|
br i1 %flag, label %if.then, label %if.else
|
|
|
|
if.then:
|
|
%r = call i1 @llvm.type.test(i8* %y, metadata !0)
|
|
br label %if.end
|
|
|
|
if.else:
|
|
%s = call i1 @llvm.type.test(i8* %z, metadata !0)
|
|
br label %if.end
|
|
|
|
if.end:
|
|
%t = phi i1 [ %s, %if.else ], [ %r, %if.then ]
|
|
ret i1 %t
|
|
}
|
|
|
|
; CHECK-LABEL: test2
|
|
; CHECK: %[[S:[a-z0-9.]+]] = select i1 %flag, i8* %y, i8* %z
|
|
; CHECK: %[[R:[a-z0-9.]+]] = call i1 @llvm.type.test(i8* %[[S]], metadata !0)
|
|
; CHECK: ret i1 %[[R]]
|
|
|