diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-06-28 22:40:43 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-06-28 22:40:43 +0000 |
commit | 97be1d608e0fd8f0578342932b3b8116e5028a02 (patch) | |
tree | 5ece32ea44d40cf58ec988e29428dac2e81215e9 /test/Analysis/BlockFrequencyInfo | |
parent | 6a636a813f33b46b3271ec8517ee1936a0c92c9f (diff) | |
download | external_llvm-97be1d608e0fd8f0578342932b3b8116e5028a02.zip external_llvm-97be1d608e0fd8f0578342932b3b8116e5028a02.tar.gz external_llvm-97be1d608e0fd8f0578342932b3b8116e5028a02.tar.bz2 |
Minimize precision loss when computing cyclic probabilities.
Allow block frequencies to exceed 32 bits by using the new
BlockFrequency division function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/BlockFrequencyInfo')
-rw-r--r-- | test/Analysis/BlockFrequencyInfo/basic.ll | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/Analysis/BlockFrequencyInfo/basic.ll b/test/Analysis/BlockFrequencyInfo/basic.ll index 43dd264..ce29fb5 100644 --- a/test/Analysis/BlockFrequencyInfo/basic.ll +++ b/test/Analysis/BlockFrequencyInfo/basic.ll @@ -90,3 +90,45 @@ exit: } !1 = metadata !{metadata !"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} + +; CHECK: Printing analysis {{.*}} for function 'nested_loops' +; CHECK: entry = 1.0 +; This test doesn't seem to be assigning sensible frequencies to nested loops. +define void @nested_loops(i32 %a) { +entry: + br label %for.cond1.preheader + +for.cond1.preheader: + %x.024 = phi i32 [ 0, %entry ], [ %inc12, %for.inc11 ] + br label %for.cond4.preheader + +for.cond4.preheader: + %y.023 = phi i32 [ 0, %for.cond1.preheader ], [ %inc9, %for.inc8 ] + %add = add i32 %y.023, %x.024 + br label %for.body6 + +for.body6: + %z.022 = phi i32 [ 0, %for.cond4.preheader ], [ %inc, %for.body6 ] + %add7 = add i32 %add, %z.022 + tail call void @g(i32 %add7) #2 + %inc = add i32 %z.022, 1 + %cmp5 = icmp ugt i32 %inc, %a + br i1 %cmp5, label %for.inc8, label %for.body6, !prof !2 + +for.inc8: + %inc9 = add i32 %y.023, 1 + %cmp2 = icmp ugt i32 %inc9, %a + br i1 %cmp2, label %for.inc11, label %for.cond4.preheader, !prof !2 + +for.inc11: + %inc12 = add i32 %x.024, 1 + %cmp = icmp ugt i32 %inc12, %a + br i1 %cmp, label %for.end13, label %for.cond1.preheader, !prof !2 + +for.end13: + ret void +} + +declare void @g(i32) #1 + +!2 = metadata !{metadata !"branch_weights", i32 1, i32 4000} |