summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll')
-rw-r--r--llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll b/llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll
new file mode 100644
index 00000000000..16d9cc54438
--- /dev/null
+++ b/llvm/test/Analysis/ScalarEvolution/exhaustive-trip-counts.ll
@@ -0,0 +1,26 @@
+; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @f_0() {
+; CHECK-LABEL: Printing analysis 'Scalar Evolution Analysis' for function 'f_0':
+; CHECK: Loop %for.body: backedge-taken count is 5
+; CHECK: Loop %for.body: max backedge-taken count is 5
+; CHECK: Loop %for.body: Predicated backedge-taken count is 5
+
+entry:
+ br label %for.body
+
+for.body:
+ %i.05 = phi i32 [ 32, %entry ], [ %div4, %for.body ]
+ tail call void @dummy()
+ %div4 = lshr i32 %i.05, 1
+ %cmp = icmp eq i32 %div4, 0
+ br i1 %cmp, label %for.cond.cleanup, label %for.body
+
+for.cond.cleanup:
+ ret void
+}
+
+declare void @dummy()
OpenPOWER on IntegriCloud