forked from OSchip/llvm-project
[Sink][test] Add nounwind test and properly test convergent
This commit is contained in:
parent
86163f885b
commit
389fd309da
|
@ -1,6 +1,7 @@
|
||||||
; RUN: opt < %s -basic-aa -sink -S | FileCheck %s
|
; RUN: opt < %s -basic-aa -sink -S | FileCheck %s
|
||||||
|
|
||||||
declare i32 @f_load_global() nounwind readonly
|
declare i32 @f_load_global() nounwind readonly
|
||||||
|
declare i32 @f_load_global_throwable() readonly
|
||||||
declare i32 @f_load_arg(i32*) nounwind readonly argmemonly
|
declare i32 @f_load_arg(i32*) nounwind readonly argmemonly
|
||||||
declare void @f_store_global(i32) nounwind
|
declare void @f_store_global(i32) nounwind
|
||||||
declare void @f_store_arg(i32*) nounwind argmemonly
|
declare void @f_store_arg(i32*) nounwind argmemonly
|
||||||
|
@ -25,6 +26,18 @@ false:
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK-LABEL: @test_throwable_no_stores(
|
||||||
|
; CHECK: %l = call i32 @f_load_global
|
||||||
|
; CHECK-NEXT: br i1 %z
|
||||||
|
define i32 @test_throwable_no_stores(i1 %z) {
|
||||||
|
%l = call i32 @f_load_global_throwable()
|
||||||
|
br i1 %z, label %true, label %false
|
||||||
|
true:
|
||||||
|
ret i32 %l
|
||||||
|
false:
|
||||||
|
ret i32 0
|
||||||
|
}
|
||||||
|
|
||||||
; CHECK-LABEL: @test_sink_argmem_store(
|
; CHECK-LABEL: @test_sink_argmem_store(
|
||||||
; CHECK: true:
|
; CHECK: true:
|
||||||
; CHECK-NEXT: %l = call i32 @f_load_arg
|
; CHECK-NEXT: %l = call i32 @f_load_arg
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
define i32 @foo(i1 %arg) {
|
define i32 @foo(i1 %arg) {
|
||||||
entry:
|
entry:
|
||||||
%c = call i32 @bar() readonly convergent
|
%c = call i32 @bar() nounwind readonly convergent
|
||||||
br i1 %arg, label %then, label %end
|
br i1 %arg, label %then, label %end
|
||||||
|
|
||||||
then:
|
then:
|
||||||
|
@ -20,4 +20,4 @@ end:
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
declare i32 @bar() readonly convergent
|
declare i32 @bar() nounwind readonly convergent
|
||||||
|
|
Loading…
Reference in New Issue