• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=x86 -enable-lsr-nested | grep cmp | grep 240
2; RUN: llc < %s -march=x86 -enable-lsr-nested | grep inc | count 1
3
4define i32 @foo(i32 %A, i32 %B, i32 %C, i32 %D) nounwind {
5entry:
6	%tmp2955 = icmp sgt i32 %C, 0		; <i1> [#uses=1]
7	br i1 %tmp2955, label %bb26.outer.us, label %bb40.split
8
9bb26.outer.us:		; preds = %bb26.bb32_crit_edge.us, %entry
10	%i.044.0.ph.us = phi i32 [ 0, %entry ], [ %indvar.next57, %bb26.bb32_crit_edge.us ]		; <i32> [#uses=2]
11	%k.1.ph.us = phi i32 [ 0, %entry ], [ %k.0.us, %bb26.bb32_crit_edge.us ]		; <i32> [#uses=1]
12	%tmp3.us = mul i32 %i.044.0.ph.us, 6		; <i32> [#uses=1]
13	br label %bb1.us
14
15bb1.us:		; preds = %bb1.us, %bb26.outer.us
16	%j.053.us = phi i32 [ 0, %bb26.outer.us ], [ %tmp25.us, %bb1.us ]		; <i32> [#uses=2]
17	%k.154.us = phi i32 [ %k.1.ph.us, %bb26.outer.us ], [ %k.0.us, %bb1.us ]		; <i32> [#uses=1]
18	%tmp5.us = add i32 %tmp3.us, %j.053.us		; <i32> [#uses=1]
19	%tmp7.us = shl i32 %D, %tmp5.us		; <i32> [#uses=2]
20	%tmp9.us = icmp eq i32 %tmp7.us, %B		; <i1> [#uses=1]
21	%tmp910.us = zext i1 %tmp9.us to i32		; <i32> [#uses=1]
22	%tmp12.us = and i32 %tmp7.us, %A		; <i32> [#uses=1]
23	%tmp19.us = and i32 %tmp12.us, %tmp910.us		; <i32> [#uses=1]
24	%k.0.us = add i32 %tmp19.us, %k.154.us		; <i32> [#uses=3]
25	%tmp25.us = add i32 %j.053.us, 1		; <i32> [#uses=2]
26	%tmp29.us = icmp slt i32 %tmp25.us, %C		; <i1> [#uses=1]
27	br i1 %tmp29.us, label %bb1.us, label %bb26.bb32_crit_edge.us
28
29bb26.bb32_crit_edge.us:		; preds = %bb1.us
30	%indvar.next57 = add i32 %i.044.0.ph.us, 1		; <i32> [#uses=2]
31	%exitcond = icmp eq i32 %indvar.next57, 40		; <i1> [#uses=1]
32	br i1 %exitcond, label %bb40.split, label %bb26.outer.us
33
34bb40.split:		; preds = %bb26.bb32_crit_edge.us, %entry
35	%k.1.lcssa.lcssa.us-lcssa = phi i32 [ %k.0.us, %bb26.bb32_crit_edge.us ], [ 0, %entry ]		; <i32> [#uses=1]
36	ret i32 %k.1.lcssa.lcssa.us-lcssa
37}
38