summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2016-08-06 20:44:39 +0000
committerGor Nishanov <GorNishanov@gmail.com>2016-08-06 20:44:39 +0000
commit2ed6e788a8f5d5fc953582277e5dd9ec2cad449a (patch)
tree246c46599d27f78d62c29ddfd8127557c3cd262c /llvm/test
parentea49d3addc79d271569830ab051950fa144310cc (diff)
downloadbcm5719-llvm-2ed6e788a8f5d5fc953582277e5dd9ec2cad449a.tar.gz
bcm5719-llvm-2ed6e788a8f5d5fc953582277e5dd9ec2cad449a.zip
[Coroutines] Part 5: Add CGSCC restart trigger
Summary: CoroSplit pass processes the coroutine twice. First, it lets it go through complete IPO optimization pipeline as a single function. It forces restart of the pipeline by inserting an indirect call to an empty function "coro.devirt.trigger" which is devirtualized by CoroElide pass that triggers a restart of the pipeline by CGPassManager. (In later patches, when CoroSplit pass sees the same coroutine the second time, it splits it up, adds coroutine subfunctions to the SCC to be processed by IPO pipeline.) Documentation and overview is here: http://llvm.org/docs/Coroutines.html. Upstreaming sequence (rough plan) 1.Add documentation. (https://reviews.llvm.org/D22603) 2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659) 3.Add empty coroutine passes. (https://reviews.llvm.org/D22847) 4.Add coroutine devirtualization + tests. ab) Lower coro.resume and coro.destroy (https://reviews.llvm.org/D22998) c) Do devirtualization (https://reviews.llvm.org/D23229) 5.Add CGSCC restart trigger + tests. <= we are here 6.Add coroutine heap elision + tests. 7.Add the rest of the logic (split into more patches) Reviewers: mehdi_amini, majnemer Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23234 llvm-svn: 277936
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/Coroutines/restart-trigger.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Coroutines/restart-trigger.ll b/llvm/test/Transforms/Coroutines/restart-trigger.ll
new file mode 100644
index 00000000000..5a186c1695a
--- /dev/null
+++ b/llvm/test/Transforms/Coroutines/restart-trigger.ll
@@ -0,0 +1,16 @@
+; Verifies that restart trigger forces IPO pipelines restart and the same
+; coroutine is looked at by CoroSplit pass twice.
+; RUN: opt < %s -S -O0 -enable-coroutines -debug-only=coro-split 2>&1 | FileCheck %s
+; RUN: opt < %s -S -O1 -enable-coroutines -debug-only=coro-split 2>&1 | FileCheck %s
+
+; CHECK: CoroSplit: Processing coroutine 'f' state: 0
+; CHECK-NEXT: CoroSplit: Processing coroutine 'f' state: 1
+
+declare i8* @llvm.coro.begin(i8*, i32, i8*, i8*)
+
+; a coroutine start function
+define i8* @f() {
+entry:
+ %hdl = call i8* @llvm.coro.begin(i8* null, i32 0, i8* null, i8* null)
+ ret i8* %hdl
+}
OpenPOWER on IntegriCloud