[llvm] 389fd30 - [Sink][test] Add nounwind test and properly test convergent
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 30 18:26:53 PDT 2020
Author: Fangrui Song
Date: 2020-08-30T18:26:42-07:00
New Revision: 389fd309da843494204fc30a899c54b3de16dd99
URL: https://github.com/llvm/llvm-project/commit/389fd309da843494204fc30a899c54b3de16dd99
DIFF: https://github.com/llvm/llvm-project/commit/389fd309da843494204fc30a899c54b3de16dd99.diff
LOG: [Sink][test] Add nounwind test and properly test convergent
Added:
Modified:
llvm/test/Transforms/Sink/call.ll
llvm/test/Transforms/Sink/convergent.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Sink/call.ll b/llvm/test/Transforms/Sink/call.ll
index 5d5e1e0164f9..1e80aeee21da 100644
--- a/llvm/test/Transforms/Sink/call.ll
+++ b/llvm/test/Transforms/Sink/call.ll
@@ -1,6 +1,7 @@
; RUN: opt < %s -basic-aa -sink -S | FileCheck %s
declare i32 @f_load_global() nounwind readonly
+declare i32 @f_load_global_throwable() readonly
declare i32 @f_load_arg(i32*) nounwind readonly argmemonly
declare void @f_store_global(i32) nounwind
declare void @f_store_arg(i32*) nounwind argmemonly
@@ -25,6 +26,18 @@ false:
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: true:
; CHECK-NEXT: %l = call i32 @f_load_arg
diff --git a/llvm/test/Transforms/Sink/convergent.ll b/llvm/test/Transforms/Sink/convergent.ll
index b209e6705468..292162b59314 100644
--- a/llvm/test/Transforms/Sink/convergent.ll
+++ b/llvm/test/Transforms/Sink/convergent.ll
@@ -10,7 +10,7 @@
define i32 @foo(i1 %arg) {
entry:
- %c = call i32 @bar() readonly convergent
+ %c = call i32 @bar() nounwind readonly convergent
br i1 %arg, label %then, label %end
then:
@@ -20,4 +20,4 @@ end:
ret i32 0
}
-declare i32 @bar() readonly convergent
+declare i32 @bar() nounwind readonly convergent
More information about the llvm-commits
mailing list