1; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s
2target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5%struct.lua_TValue.17.692 = type { %union.Value.16.691, i32 }
6%union.Value.16.691 = type { %union.GCObject.15.690* }
7%union.GCObject.15.690 = type { %struct.lua_State.14.689 }
8%struct.lua_State.14.689 = type { %union.GCObject.15.690*, i8, i8, i8, %struct.lua_TValue.17.692*, %struct.lua_TValue.17.692*, %struct.global_State.10.685*, %struct.CallInfo.11.686*, i32*, %struct.lua_TValue.17.692*, %struct.lua_TValue.17.692*, %struct.CallInfo.11.686*, %struct.CallInfo.11.686*, i32, i32, i16, i16, i8, i8, i32, i32, void (%struct.lua_State.14.689*, %struct.lua_Debug.12.687*)*, %struct.lua_TValue.17.692, %struct.lua_TValue.17.692, %union.GCObject.15.690*, %union.GCObject.15.690*, %struct.lua_longjmp.13.688*, i64 }
9%struct.global_State.10.685 = type { %struct.stringtable.0.675, i8* (i8*, i8*, i64, i64)*, i8*, i8, i8, i32, %union.GCObject.15.690*, %union.GCObject.15.690**, %union.GCObject.15.690*, %union.GCObject.15.690*, %union.GCObject.15.690*, %union.GCObject.15.690*, %struct.Mbuffer.1.676, i64, i64, i64, i64, i32, i32, i32 (%struct.lua_State.14.689*)*, %struct.lua_TValue.17.692, %struct.lua_State.14.689*, %struct.UpVal.3.678, [9 x %struct.Table.7.682*], [17 x %union.TString.9.684*] }
10%struct.stringtable.0.675 = type { %union.GCObject.15.690**, i32, i32 }
11%struct.Mbuffer.1.676 = type { i8*, i64, i64 }
12%struct.UpVal.3.678 = type { %union.GCObject.15.690*, i8, i8, %struct.lua_TValue.17.692*, %union.anon.2.677 }
13%union.anon.2.677 = type { %struct.lua_TValue.17.692 }
14%struct.Table.7.682 = type { %union.GCObject.15.690*, i8, i8, i8, i8, %struct.Table.7.682*, %struct.lua_TValue.17.692*, %struct.Node.6.681*, %struct.Node.6.681*, %union.GCObject.15.690*, i32 }
15%struct.Node.6.681 = type { %struct.lua_TValue.17.692, %union.TKey.5.680 }
16%union.TKey.5.680 = type { %struct.anon.0.4.679 }
17%struct.anon.0.4.679 = type { %union.Value.16.691, i32, %struct.Node.6.681* }
18%union.TString.9.684 = type { %struct.anon.1.8.683 }
19%struct.anon.1.8.683 = type { %union.GCObject.15.690*, i8, i8, i8, i32, i64 }
20%struct.CallInfo.11.686 = type { %struct.lua_TValue.17.692*, %struct.lua_TValue.17.692*, %struct.lua_TValue.17.692*, i32*, i32, i32 }
21%struct.lua_Debug.12.687 = type { i32, i8*, i8*, i8*, i8*, i32, i32, i32, i32, [60 x i8], i32 }
22%struct.lua_longjmp.13.688 = type opaque
23
24define void @lua_xmove(i32 signext %n) #0 {
25entry:
26  br i1 undef, label %for.end, label %if.end
27
28if.end:                                           ; preds = %entry
29  br i1 undef, label %for.body.lr.ph, label %for.end
30
31for.body.lr.ph:                                   ; preds = %if.end
32  br label %for.body
33
34for.body:                                         ; preds = %for.body.for.body_crit_edge, %for.body.lr.ph
35  %0 = phi %struct.lua_TValue.17.692* [ undef, %for.body.lr.ph ], [ %.pre, %for.body.for.body_crit_edge ]
36  %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body.for.body_crit_edge ]
37  %tt = getelementptr inbounds %struct.lua_TValue.17.692* %0, i64 %indvars.iv, i32 1
38  %1 = load i32* %tt, align 4
39  store i32 %1, i32* undef, align 4
40  %indvars.iv.next = add i64 %indvars.iv, 1
41  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
42  %exitcond = icmp eq i32 %lftr.wideiv, %n
43  br i1 %exitcond, label %for.end, label %for.body.for.body_crit_edge
44
45for.body.for.body_crit_edge:                      ; preds = %for.body
46  %.pre = load %struct.lua_TValue.17.692** undef, align 8
47  br label %for.body
48
49for.end:                                          ; preds = %for.body, %if.end, %entry
50  ret void
51
52; CHECK: @lua_xmove
53; CHECK: bnelr
54; CHECK: bnelr
55; CHECK: bdzlr
56; CHECK-NOT: blr
57}
58
59attributes #0 = { nounwind }
60