summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-07-22 00:40:56 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-07-22 00:40:56 +0000
commitbb969791b4ca0800f887288e5c35b6b46c1a810d (patch)
tree4fa4355e5837f619791a32428b17f435d9ce521f /llvm/test
parent0c5b92cae6ae06aa69a02c2b27fb5074f26420b7 (diff)
downloadbcm5719-llvm-bb969791b4ca0800f887288e5c35b6b46c1a810d.tar.gz
bcm5719-llvm-bb969791b4ca0800f887288e5c35b6b46c1a810d.zip
[IRCE] Add an option to skip profitability checks
If `-irce-skip-profitability-checks` is passed in, IRCE will kick in in all cases where it is legal for it to kick in. This flag is intended to help diagnose and analyse performance issues. llvm-svn: 276372
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/IRCE/skip-profitability-checks.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IRCE/skip-profitability-checks.ll b/llvm/test/Transforms/IRCE/skip-profitability-checks.ll
new file mode 100644
index 00000000000..f12898955b4
--- /dev/null
+++ b/llvm/test/Transforms/IRCE/skip-profitability-checks.ll
@@ -0,0 +1,31 @@
+; RUN: opt -irce-skip-profitability-checks -S -irce < %s | FileCheck %s
+
+define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) {
+; CHECK-LABEL: @single_access_no_preloop_no_offset(
+; CHECK: main.exit.selector:
+ entry:
+ %len = load i32, i32* %a_len_ptr, !range !0
+ %first.itr.check = icmp sgt i32 %n, 0
+ br i1 %first.itr.check, label %loop, label %exit
+
+ loop:
+ %idx = phi i32 [ 0, %entry ] , [ %idx.next, %in.bounds ]
+ %idx.next = add i32 %idx, 1
+ %abc = icmp slt i32 %idx, %len
+ br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1
+
+ in.bounds:
+ %addr = getelementptr i32, i32* %arr, i32 %idx
+ store i32 0, i32* %addr
+ %next = icmp slt i32 %idx.next, %n
+ br i1 %next, label %loop, label %exit
+
+ out.of.bounds:
+ ret void
+
+ exit:
+ ret void
+}
+
+!0 = !{i32 0, i32 2147483647}
+!1 = !{!"branch_weights", i32 1, i32 64}
OpenPOWER on IntegriCloud