• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=i686-- | grep align | count 4
2
3; TODO: Is it a good idea to align inner loops? It's hard to know without
4; knowing what their trip counts are, or other dynamic information. For
5; now, CodeGen aligns all loops.
6
7@x = external dso_local global i32*		; <i32**> [#uses=1]
8
9define i32 @t(i32 %a, i32 %b) nounwind readonly ssp {
10entry:
11	%0 = icmp eq i32 %a, 0		; <i1> [#uses=1]
12	br i1 %0, label %bb5, label %bb.nph12
13
14bb.nph12:		; preds = %entry
15	%1 = icmp eq i32 %b, 0		; <i1> [#uses=1]
16	%2 = load i32*, i32** @x, align 8		; <i32*> [#uses=1]
17	br i1 %1, label %bb2.preheader, label %bb2.preheader.us
18
19bb2.preheader.us:		; preds = %bb2.bb3_crit_edge.us, %bb.nph12
20	%indvar18 = phi i32 [ 0, %bb.nph12 ], [ %indvar.next19, %bb2.bb3_crit_edge.us ]		; <i32> [#uses=2]
21	%sum.111.us = phi i32 [ 0, %bb.nph12 ], [ %4, %bb2.bb3_crit_edge.us ]		; <i32> [#uses=0]
22	%tmp16 = mul i32 %indvar18, %a		; <i32> [#uses=1]
23	br label %bb1.us
24
25bb1.us:		; preds = %bb1.us, %bb2.preheader.us
26	%indvar = phi i32 [ 0, %bb2.preheader.us ], [ %indvar.next, %bb1.us ]		; <i32> [#uses=2]
27	%tmp17 = add i32 %indvar, %tmp16		; <i32> [#uses=1]
28	%tmp. = zext i32 %tmp17 to i64		; <i64> [#uses=1]
29	%3 = getelementptr i32, i32* %2, i64 %tmp.		; <i32*> [#uses=1]
30	%4 = load i32, i32* %3, align 4		; <i32> [#uses=2]
31	%indvar.next = add i32 %indvar, 1		; <i32> [#uses=2]
32	%exitcond = icmp eq i32 %indvar.next, %b		; <i1> [#uses=1]
33	br i1 %exitcond, label %bb2.bb3_crit_edge.us, label %bb1.us
34
35bb2.bb3_crit_edge.us:		; preds = %bb1.us
36	%indvar.next19 = add i32 %indvar18, 1		; <i32> [#uses=2]
37	%exitcond22 = icmp eq i32 %indvar.next19, %a		; <i1> [#uses=1]
38	br i1 %exitcond22, label %bb5, label %bb2.preheader.us
39
40bb2.preheader:		; preds = %bb2.preheader, %bb.nph12
41	%indvar24 = phi i32 [ %indvar.next25, %bb2.preheader ], [ 0, %bb.nph12 ]		; <i32> [#uses=1]
42	%indvar.next25 = add i32 %indvar24, 1		; <i32> [#uses=2]
43	%exitcond28 = icmp eq i32 %indvar.next25, %a		; <i1> [#uses=1]
44	br i1 %exitcond28, label %bb5, label %bb2.preheader
45
46bb5:		; preds = %bb2.preheader, %bb2.bb3_crit_edge.us, %entry
47	%sum.1.lcssa = phi i32 [ 0, %entry ], [ 0, %bb2.preheader ], [ %4, %bb2.bb3_crit_edge.us ]		; <i32> [#uses=1]
48	ret i32 %sum.1.lcssa
49}
50