Modify two Transforms tests to explicitly check for full function names in some cases...
[oota-llvm.git] / test / Transforms / GVN / load-pre-align.ll
1 ; RUN: opt < %s -gvn -S | FileCheck %s
2
3 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
4
5 @p = external global i32
6
7 define i32 @test(i32 %n) nounwind {
8 ; CHECK: @test
9 entry:
10   br label %for.cond
11
12 ; loads aligned greater than the memory should not be moved past conditionals
13 ; CHECK-NOT: load
14 ; CHECK: br i1
15
16 for.cond:
17   %i.0 = phi i32 [ 0, %entry ], [ %indvar.next, %for.inc ]
18   %cmp = icmp slt i32 %i.0, %n
19   br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge
20
21 for.cond.for.end_crit_edge:
22 ; ...but PRE can still move the load out of for.end to here.
23 ; CHECK: for.cond.for.end_crit_edge:
24 ; CHECK-NEXT: load
25   br label %for.end
26
27 for.body:
28   %tmp3 = load i32* @p, align 8
29   %dec = add i32 %tmp3, -1
30   store i32 %dec, i32* @p
31   %cmp6 = icmp slt i32 %dec, 0
32   br i1 %cmp6, label %for.body.for.end_crit_edge, label %for.inc
33
34 for.body.for.end_crit_edge:
35   br label %for.end
36
37 for.inc:
38   %indvar.next = add i32 %i.0, 1
39   br label %for.cond
40
41 for.end:
42   %tmp9 = load i32* @p, align 8
43   ret i32 %tmp9
44 }