summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/PGOProfile/infinite_loop_gen.ll
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2017-12-05 17:19:41 +0000
committerXinliang David Li <davidxl@google.com>2017-12-05 17:19:41 +0000
commitcc35bc9efcec964616f15daa02a41dbaddf5e29b (patch)
tree13e27360f0dacd2ef2db3bc188a8bdaf1bef126f /llvm/test/Transforms/PGOProfile/infinite_loop_gen.ll
parent748d8a28ef21890efd1aa4daa74af1bcac52d8a1 (diff)
downloadbcm5719-llvm-cc35bc9efcec964616f15daa02a41dbaddf5e29b.tar.gz
bcm5719-llvm-cc35bc9efcec964616f15daa02a41dbaddf5e29b.zip
[PGO] detect infinite loop and form MST properly
Differential Revision: http://reviews.llvm.org/D40702 llvm-svn: 319794
Diffstat (limited to 'llvm/test/Transforms/PGOProfile/infinite_loop_gen.ll')
-rw-r--r--llvm/test/Transforms/PGOProfile/infinite_loop_gen.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/PGOProfile/infinite_loop_gen.ll b/llvm/test/Transforms/PGOProfile/infinite_loop_gen.ll
new file mode 100644
index 00000000000..f200fc3857a
--- /dev/null
+++ b/llvm/test/Transforms/PGOProfile/infinite_loop_gen.ll
@@ -0,0 +1,18 @@
+; RUN: opt < %s -pgo-instr-gen -S -o - | FileCheck %s
+
+define void @foo() {
+entry:
+ br label %while.body
+; CHECK: llvm.instrprof.increment
+
+ while.body: ; preds = %entry, %while.body
+; CHECK: llvm.instrprof.increment
+ call void (...) @bar() #2
+ br label %while.body
+}
+
+declare void @bar(...)
+
+
+attributes #0 = { nounwind }
+
OpenPOWER on IntegriCloud