47 changes: 23 additions & 24 deletions polly/test/CodeGen/hoisting_1.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,41 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

%struct.hoge = type { %struct.widget*, %struct.barney*, %struct.foo*, i32, i32, %struct.wibble*, i32, i32, i32, i32, double, i32, i32, i32, %struct.foo.1*, [4 x %struct.hoge.2*], [4 x %struct.blam*], [4 x %struct.blam*], [16 x i8], [16 x i8], [16 x i8], i32, %struct.barney.3*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i16, i16, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.foo.1*], i32, i32, i32, [10 x i32], i32, i32, i32, i32, %struct.foo.4*, %struct.wombat.5*, %struct.blam.6*, %struct.foo.7*, %struct.bar*, %struct.wibble.8*, %struct.barney.9*, %struct.hoge.10*, %struct.bar.11* }
%struct.widget = type { void (%struct.quux*)*, void (%struct.quux*, i32)*, void (%struct.quux*)*, void (%struct.quux*, i8*)*, void (%struct.quux*)*, i32, %struct.hoge.0, i32, i64, i8**, i32, i8**, i32, i32 }
%struct.quux = type { %struct.widget*, %struct.barney*, %struct.foo*, i32, i32 }
%struct.hoge = type { ptr, ptr, ptr, i32, i32, ptr, i32, i32, i32, i32, double, i32, i32, i32, ptr, [4 x ptr], [4 x ptr], [4 x ptr], [16 x i8], [16 x i8], [16 x i8], i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i16, i16, i32, i32, i32, i32, i32, i32, i32, [4 x ptr], i32, i32, i32, [10 x i32], i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.widget = type { ptr, ptr, ptr, ptr, ptr, i32, %struct.hoge.0, i32, i64, ptr, i32, ptr, i32, i32 }
%struct.quux = type { ptr, ptr, ptr, i32, i32 }
%struct.hoge.0 = type { [8 x i32], [48 x i8] }
%struct.barney = type { i8* (%struct.quux*, i32, i64)*, i8* (%struct.quux*, i32, i64)*, i8** (%struct.quux*, i32, i32, i32)*, [64 x i16]** (%struct.quux*, i32, i32, i32)*, %struct.ham* (%struct.quux*, i32, i32, i32, i32, i32)*, %struct.wombat* (%struct.quux*, i32, i32, i32, i32, i32)*, {}*, i8** (%struct.quux*, %struct.ham*, i32, i32, i32)*, [64 x i16]** (%struct.quux*, %struct.wombat*, i32, i32, i32)*, void (%struct.quux*, i32)*, {}*, i64 }
%struct.barney = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64 }
%struct.ham = type opaque
%struct.wombat = type opaque
%struct.foo = type { {}*, i64, i64, i32, i32 }
%struct.wibble = type { i8*, i64, void (%struct.hoge*)*, i32 (%struct.hoge*)*, void (%struct.hoge*)* }
%struct.foo.1 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.hoge.2*, i8* }
%struct.foo = type { ptr, i64, i64, i32, i32 }
%struct.wibble = type { ptr, i64, ptr, ptr, ptr }
%struct.foo.1 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr }
%struct.hoge.2 = type { [64 x i16], i32 }
%struct.blam = type { [17 x i8], [256 x i8], i32 }
%struct.barney.3 = type { i32, [4 x i32], i32, i32, i32, i32 }
%struct.foo.4 = type { void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)*, i32, i32 }
%struct.wombat.5 = type { void (%struct.hoge*, i32)*, void (%struct.hoge*, i8**, i32*, i32)* }
%struct.blam.6 = type { void (%struct.hoge*, i32)*, void (%struct.hoge*, i8**, i32*, i32, i8***, i32*, i32)* }
%struct.foo.7 = type { void (%struct.hoge*, i32)*, i32 (%struct.hoge*, i8***)* }
%struct.bar = type { void (%struct.hoge*, i32, i8*, i32)*, void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)* }
%struct.wibble.8 = type { void (%struct.hoge*)*, void (%struct.hoge*, i8**, i8***, i32, i32)* }
%struct.barney.9 = type { void (%struct.hoge*)*, void (%struct.hoge*, i8***, i32, i8***, i32)*, i32 }
%struct.hoge.10 = type { void (%struct.hoge*)*, void (%struct.hoge*, %struct.foo.1*, i8**, [64 x i16]*, i32, i32, i32)* }
%struct.bar.11 = type { {}*, i32 (%struct.hoge*, [64 x i16]**)*, void (%struct.hoge*)* }
%struct.foo.4 = type { ptr, ptr, ptr, i32, i32 }
%struct.wombat.5 = type { ptr, ptr }
%struct.blam.6 = type { ptr, ptr }
%struct.foo.7 = type { ptr, ptr }
%struct.bar = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.wibble.8 = type { ptr, ptr }
%struct.barney.9 = type { ptr, ptr, i32 }
%struct.hoge.10 = type { ptr, ptr }
%struct.bar.11 = type { ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define void @foo(%struct.hoge* %arg) #0 {
define void @foo(ptr %arg) #0 {
bb:
br label %bb2

bb2: ; preds = %bb
%tmp3 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i32 0, i32 42
%tmp4 = getelementptr inbounds [4 x %struct.foo.1*], [4 x %struct.foo.1*]* %tmp3, i64 0, i64 0
%tmp = load %struct.foo.1*, %struct.foo.1** %tmp4, align 8, !tbaa !1
%tmp5 = getelementptr inbounds %struct.foo.1, %struct.foo.1* %tmp, i32 0, i32 7
%tmp6 = load i32, i32* %tmp5, align 4, !tbaa !5
%tmp7 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i32 0, i32 43
store i32 %tmp6, i32* %tmp7, align 8, !tbaa !8
%tmp3 = getelementptr inbounds %struct.hoge, ptr %arg, i32 0, i32 42
%tmp = load ptr, ptr %tmp3, align 8, !tbaa !1
%tmp5 = getelementptr inbounds %struct.foo.1, ptr %tmp, i32 0, i32 7
%tmp6 = load i32, ptr %tmp5, align 4, !tbaa !5
%tmp7 = getelementptr inbounds %struct.hoge, ptr %arg, i32 0, i32 43
store i32 %tmp6, ptr %tmp7, align 8, !tbaa !8
br i1 false, label %bb8, label %bb9

bb8: ; preds = %bb2
Expand Down
57 changes: 27 additions & 30 deletions polly/test/CodeGen/hoisting_2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,42 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

%struct.hoge = type { %struct.widget*, %struct.barney*, %struct.foo*, i32, i32, %struct.wibble*, i32, i32, i32, i32, double, i32, i32, i32, %struct.foo.1*, [4 x %struct.hoge.2*], [4 x %struct.blam*], [4 x %struct.blam*], [16 x i8], [16 x i8], [16 x i8], i32, %struct.barney.3*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i16, i16, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.foo.1*], i32, i32, i32, [10 x i32], i32, i32, i32, i32, %struct.foo.4*, %struct.wombat.5*, %struct.blam.6*, %struct.foo.7*, %struct.bar*, %struct.wibble.8*, %struct.barney.9*, %struct.hoge.10*, %struct.bar.11* }
%struct.widget = type { void (%struct.quux*)*, void (%struct.quux*, i32)*, void (%struct.quux*)*, void (%struct.quux*, i8*)*, void (%struct.quux*)*, i32, %struct.hoge.0, i32, i64, i8**, i32, i8**, i32, i32 }
%struct.quux = type { %struct.widget*, %struct.barney*, %struct.foo*, i32, i32 }
%struct.hoge = type { ptr, ptr, ptr, i32, i32, ptr, i32, i32, i32, i32, double, i32, i32, i32, ptr, [4 x ptr], [4 x ptr], [4 x ptr], [16 x i8], [16 x i8], [16 x i8], i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i16, i16, i32, i32, i32, i32, i32, i32, i32, [4 x ptr], i32, i32, i32, [10 x i32], i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.widget = type { ptr, ptr, ptr, ptr, ptr, i32, %struct.hoge.0, i32, i64, ptr, i32, ptr, i32, i32 }
%struct.quux = type { ptr, ptr, ptr, i32, i32 }
%struct.hoge.0 = type { [8 x i32], [48 x i8] }
%struct.barney = type { i8* (%struct.quux*, i32, i64)*, i8* (%struct.quux*, i32, i64)*, i8** (%struct.quux*, i32, i32, i32)*, [64 x i16]** (%struct.quux*, i32, i32, i32)*, %struct.ham* (%struct.quux*, i32, i32, i32, i32, i32)*, %struct.wombat* (%struct.quux*, i32, i32, i32, i32, i32)*, {}*, i8** (%struct.quux*, %struct.ham*, i32, i32, i32)*, [64 x i16]** (%struct.quux*, %struct.wombat*, i32, i32, i32)*, void (%struct.quux*, i32)*, {}*, i64 }
%struct.barney = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64 }
%struct.ham = type opaque
%struct.wombat = type opaque
%struct.foo = type { {}*, i64, i64, i32, i32 }
%struct.wibble = type { i8*, i64, void (%struct.hoge*)*, i32 (%struct.hoge*)*, void (%struct.hoge*)* }
%struct.foo.1 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.hoge.2*, i8* }
%struct.foo = type { ptr, i64, i64, i32, i32 }
%struct.wibble = type { ptr, i64, ptr, ptr, ptr }
%struct.foo.1 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr }
%struct.hoge.2 = type { [64 x i16], i32 }
%struct.blam = type { [17 x i8], [256 x i8], i32 }
%struct.barney.3 = type { i32, [4 x i32], i32, i32, i32, i32 }
%struct.foo.4 = type { void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)*, i32, i32 }
%struct.wombat.5 = type { void (%struct.hoge*, i32)*, void (%struct.hoge*, i8**, i32*, i32)* }
%struct.blam.6 = type { void (%struct.hoge*, i32)*, void (%struct.hoge*, i8**, i32*, i32, i8***, i32*, i32)* }
%struct.foo.7 = type { void (%struct.hoge*, i32)*, i32 (%struct.hoge*, i8***)* }
%struct.bar = type { void (%struct.hoge*, i32, i8*, i32)*, void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)*, void (%struct.hoge*)* }
%struct.wibble.8 = type { void (%struct.hoge*)*, void (%struct.hoge*, i8**, i8***, i32, i32)* }
%struct.barney.9 = type { void (%struct.hoge*)*, void (%struct.hoge*, i8***, i32, i8***, i32)*, i32 }
%struct.hoge.10 = type { void (%struct.hoge*)*, void (%struct.hoge*, %struct.foo.1*, i8**, [64 x i16]*, i32, i32, i32)* }
%struct.bar.11 = type { {}*, i32 (%struct.hoge*, [64 x i16]**)*, void (%struct.hoge*)* }
%struct.foo.4 = type { ptr, ptr, ptr, i32, i32 }
%struct.wombat.5 = type { ptr, ptr }
%struct.blam.6 = type { ptr, ptr }
%struct.foo.7 = type { ptr, ptr }
%struct.bar = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.wibble.8 = type { ptr, ptr }
%struct.barney.9 = type { ptr, ptr, i32 }
%struct.hoge.10 = type { ptr, ptr }
%struct.bar.11 = type { ptr, ptr, ptr }
%struct.foo.12 = type { %struct.foo.4, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define void @eggs(%struct.hoge* %arg) #0 {
define void @eggs(ptr %arg) #0 {
bb:
%tmp = load %struct.barney.3*, %struct.barney.3** undef, align 8, !tbaa !1
%tmp = load ptr, ptr undef, align 8, !tbaa !1
br label %bb5

bb5: ; preds = %bb
%tmp6 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i32 0, i32 51
%tmp7 = load %struct.foo.4*, %struct.foo.4** %tmp6, align 8, !tbaa !9
%tmp8 = bitcast %struct.foo.4* %tmp7 to %struct.foo.12*
%tmp9 = getelementptr inbounds %struct.foo.12, %struct.foo.12* %tmp8, i32 0, i32 4
%tmp10 = load i32, i32* %tmp9, align 4, !tbaa !10
%tmp11 = getelementptr inbounds %struct.barney.3, %struct.barney.3* %tmp, i64 0
%tmp12 = getelementptr inbounds %struct.barney.3, %struct.barney.3* %tmp11, i32 0, i32 0
%tmp151 = load i32, i32* %tmp12, align 4, !tbaa !13
%tmp6 = getelementptr inbounds %struct.hoge, ptr %arg, i32 0, i32 51
%tmp7 = load ptr, ptr %tmp6, align 8, !tbaa !9
%tmp9 = getelementptr inbounds %struct.foo.12, ptr %tmp7, i32 0, i32 4
%tmp10 = load i32, ptr %tmp9, align 4, !tbaa !10
%tmp151 = load i32, ptr %tmp, align 4, !tbaa !13
%tmp162 = icmp slt i32 0, %tmp151
br i1 %tmp162, label %bb17.lr.ph, label %bb22

Expand All @@ -50,11 +47,11 @@ bb17.lr.ph: ; preds = %bb5
bb17: ; preds = %bb17.lr.ph, %bb17
%tmp143 = phi i32 [ 0, %bb17.lr.ph ], [ %tmp21, %bb17 ]
%tmp18 = sext i32 %tmp143 to i64
%tmp19 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i32 0, i32 42
%tmp20 = getelementptr inbounds [4 x %struct.foo.1*], [4 x %struct.foo.1*]* %tmp19, i64 0, i64 %tmp18
store %struct.foo.1* undef, %struct.foo.1** %tmp20, align 8, !tbaa !15
%tmp19 = getelementptr inbounds %struct.hoge, ptr %arg, i32 0, i32 42
%tmp20 = getelementptr inbounds [4 x ptr], ptr %tmp19, i64 0, i64 %tmp18
store ptr undef, ptr %tmp20, align 8, !tbaa !15
%tmp21 = add nsw i32 %tmp143, 1
%tmp15 = load i32, i32* %tmp12, align 4, !tbaa !13
%tmp15 = load i32, ptr %tmp, align 4, !tbaa !13
%tmp16 = icmp slt i32 %tmp21, %tmp15
br i1 %tmp16, label %bb17, label %bb13.bb22_crit_edge

Expand Down
14 changes: 7 additions & 7 deletions polly/test/CodeGen/if-conditions-in-vector-code.ll
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

; CHECK: polly.split_new_and_old

define void @foo(float* %A) {
define void @foo(ptr %A) {
bb:
br label %bb1

Expand All @@ -38,10 +38,10 @@ bb2: ; preds = %bb1
br i1 %tmp3, label %bb8, label %bb4

bb4: ; preds = %bb2
%tmp5 = getelementptr inbounds float, float* %A, i64 %i.0
%tmp6 = load float, float* %tmp5, align 4
%tmp5 = getelementptr inbounds float, ptr %A, i64 %i.0
%tmp6 = load float, ptr %tmp5, align 4
%tmp7 = fadd float %tmp6, 2.000000e+00
store float %tmp7, float* %tmp5, align 4
store float %tmp7, ptr %tmp5, align 4
br label %bb8

bb8: ; preds = %bb2, %bb4
Expand All @@ -50,10 +50,10 @@ bb8: ; preds = %bb2, %bb4
br i1 %tmp10, label %bb15, label %bb11

bb11: ; preds = %bb8
%tmp12 = getelementptr inbounds float, float* %A, i64 %i.0
%tmp13 = load float, float* %tmp12, align 4
%tmp12 = getelementptr inbounds float, ptr %A, i64 %i.0
%tmp13 = load float, ptr %tmp12, align 4
%tmp14 = fadd float %tmp13, 3.000000e+00
store float %tmp14, float* %tmp12, align 4
store float %tmp14, ptr %tmp12, align 4
br label %bb15

bb15: ; preds = %bb8, %bb11
Expand Down
11 changes: 5 additions & 6 deletions polly/test/CodeGen/inner_scev_sdiv_1.ll
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
;
target triple = "x86_64-unknown-linux-gnu"

define void @_vorbis_apply_window(float* %d) {
define void @_vorbis_apply_window(ptr %d) {
entry:
%0 = load float*, float** undef, align 8
%0 = load ptr, ptr undef, align 8
%div23.neg = sdiv i64 0, -4
%sub24 = add i64 0, %div23.neg
br label %for.cond.30.preheader
Expand All @@ -38,10 +38,9 @@ for.cond.60.preheader: ; preds = %for.body.51, %for.c

for.body.51: ; preds = %for.body.51, %for.body.51.lr.ph
%indvars.iv86 = phi i64 [ %2, %for.body.51.lr.ph ], [ undef, %for.body.51 ]
%arrayidx53 = getelementptr inbounds float, float* %0, i64 %indvars.iv86
%3 = load float, float* %arrayidx53, align 4
%arrayidx55 = getelementptr inbounds float, float* %d, i64 0
%arrayidx53 = getelementptr inbounds float, ptr %0, i64 %indvars.iv86
%3 = load float, ptr %arrayidx53, align 4
%mul56 = fmul float %3, undef
store float %mul56, float* %arrayidx55, align 4
store float %mul56, ptr %d, align 4
br i1 false, label %for.body.51, label %for.cond.60.preheader
}
11 changes: 5 additions & 6 deletions polly/test/CodeGen/inner_scev_sdiv_2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
;
target triple = "x86_64-unknown-linux-gnu"

define void @_vorbis_apply_window(float* %d, i64 %param) {
define void @_vorbis_apply_window(ptr %d, i64 %param) {
entry:
%0 = load float*, float** undef, align 8
%0 = load ptr, ptr undef, align 8
%div23.neg = sdiv i64 0, -4
%sub24 = add i64 0, %div23.neg
br label %for.cond.30.preheader
Expand All @@ -35,10 +35,9 @@ for.cond.60.preheader: ; preds = %for.body.51, %for.c

for.body.51: ; preds = %for.body.51, %for.body.51.lr.ph
%indvars.iv86 = phi i64 [ %2, %for.body.51.lr.ph ], [ undef, %for.body.51 ]
%arrayidx53 = getelementptr inbounds float, float* %0, i64 %indvars.iv86
%3 = load float, float* %arrayidx53, align 4
%arrayidx55 = getelementptr inbounds float, float* %d, i64 0
%arrayidx53 = getelementptr inbounds float, ptr %0, i64 %indvars.iv86
%3 = load float, ptr %arrayidx53, align 4
%mul56 = fmul float %3, undef
store float %mul56, float* %arrayidx55, align 4
store float %mul56, ptr %d, align 4
br i1 false, label %for.body.51, label %for.cond.60.preheader
}
11 changes: 5 additions & 6 deletions polly/test/CodeGen/inner_scev_sdiv_3.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
;
target triple = "x86_64-unknown-linux-gnu"

define i64 @_vorbis_apply_window(float* %d, i64 %param) {
define i64 @_vorbis_apply_window(ptr %d, i64 %param) {
entry:
%0 = load float*, float** undef, align 8
%0 = load ptr, ptr undef, align 8
%div23.neg = sdiv i64 0, -4
%sub24 = add i64 0, %div23.neg
br label %for.cond.30.preheader
Expand Down Expand Up @@ -37,10 +37,9 @@ end:

for.body.51: ; preds = %for.body.51, %for.body.51.lr.ph
%indvars.iv86 = phi i64 [ %2, %for.body.51.lr.ph ], [ undef, %for.body.51 ]
%arrayidx53 = getelementptr inbounds float, float* %0, i64 %indvars.iv86
%3 = load float, float* %arrayidx53, align 4
%arrayidx55 = getelementptr inbounds float, float* %d, i64 0
%arrayidx53 = getelementptr inbounds float, ptr %0, i64 %indvars.iv86
%3 = load float, ptr %arrayidx53, align 4
%mul56 = fmul float %3, undef
store float %mul56, float* %arrayidx55, align 4
store float %mul56, ptr %d, align 4
br i1 false, label %for.body.51, label %for.cond.60.preheader
}
12 changes: 6 additions & 6 deletions polly/test/CodeGen/inner_scev_sdiv_in_lb.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A, i32 %N) {
define void @f(ptr %A, i32 %N) {
bb:
%tmp = sext i32 %N to i64
br label %bb3
Expand All @@ -34,12 +34,12 @@ bb6: ; preds = %bb17, %bb5
br i1 %tmp10, label %bb11, label %bb18

bb11: ; preds = %bb6
%tmp12 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
%tmp13 = load i32, i32* %tmp12, align 4
%tmp14 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv1
%tmp15 = load i32, i32* %tmp14, align 4
%tmp12 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%tmp13 = load i32, ptr %tmp12, align 4
%tmp14 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv1
%tmp15 = load i32, ptr %tmp14, align 4
%tmp16 = add nsw i32 %tmp15, %tmp13
store i32 %tmp16, i32* %tmp14, align 4
store i32 %tmp16, ptr %tmp14, align 4
br label %bb17

bb17: ; preds = %bb11
Expand Down
12 changes: 6 additions & 6 deletions polly/test/CodeGen/inner_scev_sdiv_in_lb_invariant.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A, i32 %N) {
define void @f(ptr %A, i32 %N) {
bb:
%tmp = sdiv i32 %N, 4
%tmp2 = sext i32 %tmp to i64
Expand All @@ -25,12 +25,12 @@ bb1: ; preds = %bb11, %bb

bb4: ; preds = %bb1
%tmp5 = add nsw i64 %indvars.iv, -1
%tmp6 = getelementptr inbounds i32, i32* %A, i64 %tmp5
%tmp7 = load i32, i32* %tmp6, align 4
%tmp8 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
%tmp9 = load i32, i32* %tmp8, align 4
%tmp6 = getelementptr inbounds i32, ptr %A, i64 %tmp5
%tmp7 = load i32, ptr %tmp6, align 4
%tmp8 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%tmp9 = load i32, ptr %tmp8, align 4
%tmp10 = add nsw i32 %tmp9, %tmp7
store i32 %tmp10, i32* %tmp8, align 4
store i32 %tmp10, ptr %tmp8, align 4
br label %bb11

bb11: ; preds = %bb4
Expand Down
10 changes: 5 additions & 5 deletions polly/test/CodeGen/inner_scev_sdiv_in_rtc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A, i32* %B, i32 %N) {
define void @f(ptr %A, ptr %B, i32 %N) {
bb:
br label %bb1

Expand All @@ -24,12 +24,12 @@ bb1: ; preds = %bb9, %bb
bb2: ; preds = %bb1
%tmp = sdiv i32 %i.0, 42
%tmp3 = sext i32 %tmp to i64
%tmp4 = getelementptr inbounds i32, i32* %B, i64 %tmp3
%tmp5 = load i32, i32* %tmp4, align 4
%tmp4 = getelementptr inbounds i32, ptr %B, i64 %tmp3
%tmp5 = load i32, ptr %tmp4, align 4
%tmp6 = srem i32 %i.0, 3
%tmp7 = sext i32 %tmp6 to i64
%tmp8 = getelementptr inbounds i32, i32* %A, i64 %tmp7
store i32 %tmp5, i32* %tmp8, align 4
%tmp8 = getelementptr inbounds i32, ptr %A, i64 %tmp7
store i32 %tmp5, ptr %tmp8, align 4
br label %bb9

bb9: ; preds = %bb2
Expand Down
27 changes: 13 additions & 14 deletions polly/test/CodeGen/intrinsics_lifetime.ll
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @jd() #0 {
entry:
%tmp = alloca [1024 x i32], align 16
%tmp3 = bitcast [1024 x i32]* %tmp to i8*
br label %for.cond

for.cond: ; preds = %for.inc11, %entry
Expand All @@ -33,7 +32,7 @@ for.cond: ; preds = %for.inc11, %entry
br i1 %exitcond5, label %for.body, label %for.end13

for.body: ; preds = %for.cond
call void @llvm.lifetime.start(i64 4096, i8* %tmp3) #1
call void @llvm.lifetime.start(i64 4096, ptr %tmp) #1
br label %for.cond2

for.cond2: ; preds = %for.inc, %for.body
Expand All @@ -43,24 +42,24 @@ for.cond2: ; preds = %for.inc, %for.body
br i1 %exitcond, label %for.body4, label %for.end

for.body4: ; preds = %for.cond2
%arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv1
%tmp6 = load i32, i32* %arrayidx, align 4
%arrayidx6 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
%tmp7 = load i32, i32* %arrayidx6, align 4
%arrayidx = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv1
%tmp6 = load i32, ptr %arrayidx, align 4
%arrayidx6 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
%tmp7 = load i32, ptr %arrayidx6, align 4
%add = add nsw i32 %tmp7, %tmp6
store i32 %add, i32* %arrayidx6, align 4
store i32 %add, ptr %arrayidx6, align 4
br label %for.inc

for.inc: ; preds = %for.body4
%indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
br label %for.cond2

for.end: ; preds = %for.cond2
%arrayidx8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
%tmp8 = load i32, i32* %arrayidx8, align 4
%arrayidx10 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv3
store i32 %tmp8, i32* %arrayidx10, align 4
call void @llvm.lifetime.end(i64 4096, i8* %tmp3) #1
%arrayidx8 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
%tmp8 = load i32, ptr %arrayidx8, align 4
%arrayidx10 = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv3
store i32 %tmp8, ptr %arrayidx10, align 4
call void @llvm.lifetime.end(i64 4096, ptr %tmp) #1
br label %for.inc11

for.inc11: ; preds = %for.end
Expand All @@ -72,10 +71,10 @@ for.end13: ; preds = %for.cond
}

; Function Attrs: nounwind
declare void @llvm.lifetime.start(i64, i8* nocapture) #1
declare void @llvm.lifetime.start(i64, ptr nocapture) #1

; Function Attrs: nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture) #1
declare void @llvm.lifetime.end(i64, ptr nocapture) #1

attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { nounwind }
29 changes: 14 additions & 15 deletions polly/test/CodeGen/intrinsics_misc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; Verify that we remove the misc intrinsics from the optimized SCoP.
;
; CHECK: for.body:
; CHECK: call {}* @llvm.invariant.start
; CHECK: call ptr @llvm.invariant.start
; CHECK: for.body4:
; CHECK: call void @llvm.assume
; CHECK: call i1 @llvm.expect.i1
Expand Down Expand Up @@ -31,7 +31,6 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @jd() #0 {
entry:
%tmp = alloca [1024 x i32], align 16
%tmp3 = bitcast [1024 x i32]* @A to i8*
br label %for.cond

for.cond: ; preds = %for.inc11, %entry
Expand All @@ -40,7 +39,7 @@ for.cond: ; preds = %for.inc11, %entry
br i1 %exitcond5, label %for.body, label %for.end13

for.body: ; preds = %for.cond
%lis = call {}* @llvm.invariant.start(i64 4096, i8* %tmp3) #1
%lis = call ptr @llvm.invariant.start(i64 4096, ptr @A) #1
br label %for.cond2

for.cond2: ; preds = %for.inc, %for.body
Expand All @@ -52,25 +51,25 @@ for.cond2: ; preds = %for.inc, %for.body
for.body4: ; preds = %for.cond2
call void @llvm.assume(i1 %exitcond)
call i1 @llvm.expect.i1(i1 %exitcond, i1 1)
%arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv1
%tmp6 = load i32, i32* %arrayidx, align 4
%arrayidx6 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
%arrayidx = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv1
%tmp6 = load i32, ptr %arrayidx, align 4
%arrayidx6 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
call void @llvm.donothing()
%tmp7 = load i32, i32* %arrayidx6, align 4
%tmp7 = load i32, ptr %arrayidx6, align 4
%add = add nsw i32 %tmp7, %tmp6
store i32 %add, i32* %arrayidx6, align 4
store i32 %add, ptr %arrayidx6, align 4
br label %for.inc

for.inc: ; preds = %for.body4
%indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
br label %for.cond2

for.end: ; preds = %for.cond2
%arrayidx8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %tmp, i64 0, i64 %indvars.iv3
%tmp8 = load i32, i32* %arrayidx8, align 4
%arrayidx10 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv3
call void @llvm.invariant.end({}* %lis, i64 4096, i8* %tmp3) #1
store i32 %tmp8, i32* %arrayidx10, align 4
%arrayidx8 = getelementptr inbounds [1024 x i32], ptr %tmp, i64 0, i64 %indvars.iv3
%tmp8 = load i32, ptr %arrayidx8, align 4
%arrayidx10 = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv3
call void @llvm.invariant.end(ptr %lis, i64 4096, ptr @A) #1
store i32 %tmp8, ptr %arrayidx10, align 4
br label %for.inc11

for.inc11: ; preds = %for.end
Expand All @@ -91,10 +90,10 @@ declare void @llvm.assume(i1) #1
declare i1 @llvm.expect.i1(i1, i1) #1

; Function Attrs: nounwind
declare {}* @llvm.invariant.start(i64, i8* nocapture) #1
declare ptr @llvm.invariant.start(i64, ptr nocapture) #1

; Function Attrs: nounwind
declare void @llvm.invariant.end({}*, i64, i8* nocapture) #1
declare void @llvm.invariant.end(ptr, i64, ptr nocapture) #1

attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" }
attributes #1 = { nounwind }
73 changes: 34 additions & 39 deletions polly/test/CodeGen/inv-load-lnt-crash-wrong-order-2.ll

Large diffs are not rendered by default.

56 changes: 25 additions & 31 deletions polly/test/CodeGen/inv-load-lnt-crash-wrong-order-3.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,57 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

%struct.colocated_params = type { i32, i32, i32, [6 x [33 x i64]], i8***, i64***, i16****, i8**, [6 x [33 x i64]], i8***, i64***, i16****, i8**, [6 x [33 x i64]], i8***, i64***, i16****, i8**, i8, i8** }
%struct.storable_picture9 = type { i32, i32, i32, i32, i32, [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16**, i16***, i8*, i16**, i8***, i64***, i64***, i16****, i8**, i8**, %struct.storable_picture9*, %struct.storable_picture9*, %struct.storable_picture9*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, %struct.DecRefPicMarking_s*, i32 }
%struct.DecRefPicMarking_s = type { i32, i32, i32, i32, i32, %struct.DecRefPicMarking_s* }
%struct.colocated_params = type { i32, i32, i32, [6 x [33 x i64]], ptr, ptr, ptr, ptr, [6 x [33 x i64]], ptr, ptr, ptr, ptr, [6 x [33 x i64]], ptr, ptr, ptr, ptr, i8, ptr }
%struct.storable_picture9 = type { i32, i32, i32, i32, i32, [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], [50 x [6 x [33 x i64]]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, ptr, i32 }
%struct.DecRefPicMarking_s = type { i32, i32, i32, i32, i32, ptr }

; Function Attrs: nounwind uwtable
define void @compute_colocated(%struct.colocated_params* %p) #0 {
define void @compute_colocated(ptr %p) #0 {
entry:
%tmp = load %struct.storable_picture9*, %struct.storable_picture9** undef, align 8
%tmp = load ptr, ptr undef, align 8
br label %for.body.393

for.body.393: ; preds = %if.end.549, %entry
br i1 undef, label %if.then.397, label %if.else.643

if.then.397: ; preds = %for.body.393
%ref_idx456 = getelementptr inbounds %struct.storable_picture9, %struct.storable_picture9* %tmp, i64 0, i32 36
%tmp1 = load i8***, i8**** %ref_idx456, align 8
%tmp2 = load i8**, i8*** %tmp1, align 8
%arrayidx458 = getelementptr inbounds i8*, i8** %tmp2, i64 0
%tmp3 = load i8*, i8** %arrayidx458, align 8
%arrayidx459 = getelementptr inbounds i8, i8* %tmp3, i64 0
%tmp4 = load i8, i8* %arrayidx459, align 1
%ref_idx456 = getelementptr inbounds %struct.storable_picture9, ptr %tmp, i64 0, i32 36
%tmp1 = load ptr, ptr %ref_idx456, align 8
%tmp2 = load ptr, ptr %tmp1, align 8
%tmp3 = load ptr, ptr %tmp2, align 8
%tmp4 = load i8, ptr %tmp3, align 1
%cmp461 = icmp eq i8 %tmp4, -1
br i1 %cmp461, label %if.then.463, label %if.else.476

if.then.463: ; preds = %if.then.397
br label %if.end.501

if.else.476: ; preds = %if.then.397
%ref_id491 = getelementptr inbounds %struct.storable_picture9, %struct.storable_picture9* %tmp, i64 0, i32 38
%tmp5 = load i64***, i64**** %ref_id491, align 8
%ref_id491 = getelementptr inbounds %struct.storable_picture9, ptr %tmp, i64 0, i32 38
%tmp5 = load ptr, ptr %ref_id491, align 8
br label %if.end.501

if.end.501: ; preds = %if.else.476, %if.then.463
%tmp6 = load i8***, i8**** %ref_idx456, align 8
%arrayidx505 = getelementptr inbounds i8**, i8*** %tmp6, i64 1
%tmp7 = load i8**, i8*** %arrayidx505, align 8
%arrayidx506 = getelementptr inbounds i8*, i8** %tmp7, i64 0
%tmp8 = load i8*, i8** %arrayidx506, align 8
%arrayidx507 = getelementptr inbounds i8, i8* %tmp8, i64 0
%tmp9 = load i8, i8* %arrayidx507, align 1
%tmp6 = load ptr, ptr %ref_idx456, align 8
%arrayidx505 = getelementptr inbounds ptr, ptr %tmp6, i64 1
%tmp7 = load ptr, ptr %arrayidx505, align 8
%tmp8 = load ptr, ptr %tmp7, align 8
%tmp9 = load i8, ptr %tmp8, align 1
%cmp509 = icmp eq i8 %tmp9, -1
%ref_idx514 = getelementptr inbounds %struct.colocated_params, %struct.colocated_params* %p, i64 0, i32 4
%tmp10 = load i8***, i8**** %ref_idx514, align 8
%arrayidx515 = getelementptr inbounds i8**, i8*** %tmp10, i64 1
%tmp11 = load i8**, i8*** %arrayidx515, align 8
%arrayidx516 = getelementptr inbounds i8*, i8** %tmp11, i64 0
%tmp12 = load i8*, i8** %arrayidx516, align 8
%arrayidx517 = getelementptr inbounds i8, i8* %tmp12, i64 0
%ref_idx514 = getelementptr inbounds %struct.colocated_params, ptr %p, i64 0, i32 4
%tmp10 = load ptr, ptr %ref_idx514, align 8
%arrayidx515 = getelementptr inbounds ptr, ptr %tmp10, i64 1
%tmp11 = load ptr, ptr %arrayidx515, align 8
%tmp12 = load ptr, ptr %tmp11, align 8
br i1 %cmp509, label %if.then.511, label %if.else.524

if.then.511: ; preds = %if.end.501
br label %if.end.549

if.else.524: ; preds = %if.end.501
store i8 %tmp9, i8* %arrayidx517, align 1
%ref_id539 = getelementptr inbounds %struct.storable_picture9, %struct.storable_picture9* %tmp, i64 0, i32 38
%tmp13 = load i64***, i64**** %ref_id539, align 8
store i8 %tmp9, ptr %tmp12, align 1
%ref_id539 = getelementptr inbounds %struct.storable_picture9, ptr %tmp, i64 0, i32 38
%tmp13 = load ptr, ptr %ref_id539, align 8
br label %if.end.549

if.end.549: ; preds = %if.else.524, %if.then.511
Expand Down
73 changes: 35 additions & 38 deletions polly/test/CodeGen/inv-load-lnt-crash-wrong-order.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,40 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

%struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606 = type { %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605* }
%struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588 = type { i32, %struct.Production.29.62.95.326.491.854.920.953.986.1052.2040.2139.2172.2584*, i32, i32, i32, i32, %struct.anon.0.30.63.96.327.492.855.921.954.987.1053.2041.2140.2173.2585, %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591*, %struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586, %struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586, %struct.anon.1.32.65.98.329.494.857.923.956.989.1055.2043.2142.2175.2587, i32, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588* }
%struct.Production.29.62.95.326.491.854.920.953.986.1052.2040.2139.2172.2584 = type { i8*, i32, %struct.anon.9.42.75.306.471.834.900.933.966.1032.2020.2119.2152.2581, i32, i8, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*, [8 x %struct.Production.29.62.95.326.491.854.920.953.986.1052.2040.2139.2172.2584*], [8 x %struct.Declaration.13.46.79.310.475.838.904.937.970.1036.2024.2123.2156.2582*], %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591*, %struct.Term.18.51.84.315.480.843.909.942.975.1041.2029.2128.2161.2583*, %struct.Production.29.62.95.326.491.854.920.953.986.1052.2040.2139.2172.2584* }
%struct.anon.9.42.75.306.471.834.900.933.966.1032.2020.2119.2152.2581 = type { i32, i32, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588**, [3 x %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*] }
%struct.Declaration.13.46.79.310.475.838.904.937.970.1036.2024.2123.2156.2582 = type { %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591*, i32, i32 }
%struct.Term.18.51.84.315.480.843.909.942.975.1041.2029.2128.2161.2583 = type { i32, i32, i32, i32, i32, i8*, i32, i8, %struct.Production.29.62.95.326.491.854.920.953.986.1052.2040.2139.2172.2584* }
%struct.anon.0.30.63.96.327.492.855.921.954.987.1053.2041.2140.2173.2585 = type { i32, i32, %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591**, [3 x %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591*] }
%struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591 = type { i32, i32, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*, %union.anon.11.44.77.308.473.836.902.935.968.1034.2022.2121.2154.2590 }
%struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606 = type { ptr, ptr, ptr }
%struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588 = type { i32, ptr, i32, i32, i32, i32, %struct.anon.0.30.63.96.327.492.855.921.954.987.1053.2041.2140.2173.2585, ptr, %struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586, %struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586, %struct.anon.1.32.65.98.329.494.857.923.956.989.1055.2043.2142.2175.2587, i32, ptr }
%struct.Production.29.62.95.326.491.854.920.953.986.1052.2040.2139.2172.2584 = type { ptr, i32, %struct.anon.9.42.75.306.471.834.900.933.966.1032.2020.2119.2152.2581, i32, i8, ptr, [8 x ptr], [8 x ptr], ptr, ptr, ptr, ptr }
%struct.anon.9.42.75.306.471.834.900.933.966.1032.2020.2119.2152.2581 = type { i32, i32, ptr, [3 x ptr] }
%struct.Declaration.13.46.79.310.475.838.904.937.970.1036.2024.2123.2156.2582 = type { ptr, i32, i32 }
%struct.Term.18.51.84.315.480.843.909.942.975.1041.2029.2128.2161.2583 = type { i32, i32, i32, i32, i32, ptr, i32, i8, ptr }
%struct.anon.0.30.63.96.327.492.855.921.954.987.1053.2041.2140.2173.2585 = type { i32, i32, ptr, [3 x ptr] }
%struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591 = type { i32, i32, ptr, %union.anon.11.44.77.308.473.836.902.935.968.1034.2022.2121.2154.2590 }
%union.anon.11.44.77.308.473.836.902.935.968.1034.2022.2121.2154.2590 = type { %struct.Unresolved.10.43.76.307.472.835.901.934.967.1033.2021.2120.2153.2589 }
%struct.Unresolved.10.43.76.307.472.835.901.934.967.1033.2021.2120.2153.2589 = type { i8*, i32 }
%struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586 = type { i8*, i32 }
%struct.anon.1.32.65.98.329.494.857.923.956.989.1055.2043.2142.2175.2587 = type { i32, i32, %struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586**, [3 x %struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586*] }
%struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605 = type { i32, i64, %struct.anon.2.14.47.80.311.476.839.905.938.971.1037.2025.2124.2157.2592, %struct.anon.3.15.48.81.312.477.840.906.939.972.1038.2026.2125.2158.2593, %struct.VecGoto.17.50.83.314.479.842.908.941.974.1040.2028.2127.2160.2595, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, %struct.VecHint.22.55.88.319.484.847.913.946.979.1045.2033.2132.2165.2599, %struct.VecHint.22.55.88.319.484.847.913.946.979.1045.2033.2132.2165.2599, %struct.Scanner.27.60.93.324.489.852.918.951.984.1050.2038.2137.2170.2604, i8, i8*, i32, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588* }
%struct.anon.2.14.47.80.311.476.839.905.938.971.1037.2025.2124.2157.2592 = type { i32, i32, %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591**, [3 x %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591*] }
%struct.anon.3.15.48.81.312.477.840.906.939.972.1038.2026.2125.2158.2593 = type { i32, i32, %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591**, [3 x %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591*] }
%struct.VecGoto.17.50.83.314.479.842.908.941.974.1040.2028.2127.2160.2595 = type { i32, i32, %struct.Goto.16.49.82.313.478.841.907.940.973.1039.2027.2126.2159.2594**, [3 x %struct.Goto.16.49.82.313.478.841.907.940.973.1039.2027.2126.2159.2594*] }
%struct.Goto.16.49.82.313.478.841.907.940.973.1039.2027.2126.2159.2594 = type { %struct.Elem.12.45.78.309.474.837.903.936.969.1035.2023.2122.2155.2591*, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605* }
%struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597 = type { i32, i32, %struct.Action.19.52.85.316.481.844.910.943.976.1042.2030.2129.2162.2596**, [3 x %struct.Action.19.52.85.316.481.844.910.943.976.1042.2030.2129.2162.2596*] }
%struct.Action.19.52.85.316.481.844.910.943.976.1042.2030.2129.2162.2596 = type { i32, %struct.Term.18.51.84.315.480.843.909.942.975.1041.2029.2128.2161.2583*, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, i32, i8* }
%struct.VecHint.22.55.88.319.484.847.913.946.979.1045.2033.2132.2165.2599 = type { i32, i32, %struct.Hint.21.54.87.318.483.846.912.945.978.1044.2032.2131.2164.2598**, [3 x %struct.Hint.21.54.87.318.483.846.912.945.978.1044.2032.2131.2164.2598*] }
%struct.Hint.21.54.87.318.483.846.912.945.978.1044.2032.2131.2164.2598 = type { i32, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588* }
%struct.Unresolved.10.43.76.307.472.835.901.934.967.1033.2021.2120.2153.2589 = type { ptr, i32 }
%struct.Code.31.64.97.328.493.856.922.955.988.1054.2042.2141.2174.2586 = type { ptr, i32 }
%struct.anon.1.32.65.98.329.494.857.923.956.989.1055.2043.2142.2175.2587 = type { i32, i32, ptr, [3 x ptr] }
%struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605 = type { i32, i64, %struct.anon.2.14.47.80.311.476.839.905.938.971.1037.2025.2124.2157.2592, %struct.anon.3.15.48.81.312.477.840.906.939.972.1038.2026.2125.2158.2593, %struct.VecGoto.17.50.83.314.479.842.908.941.974.1040.2028.2127.2160.2595, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, %struct.VecHint.22.55.88.319.484.847.913.946.979.1045.2033.2132.2165.2599, %struct.VecHint.22.55.88.319.484.847.913.946.979.1045.2033.2132.2165.2599, %struct.Scanner.27.60.93.324.489.852.918.951.984.1050.2038.2137.2170.2604, i8, ptr, i32, ptr, ptr, ptr, ptr }
%struct.anon.2.14.47.80.311.476.839.905.938.971.1037.2025.2124.2157.2592 = type { i32, i32, ptr, [3 x ptr] }
%struct.anon.3.15.48.81.312.477.840.906.939.972.1038.2026.2125.2158.2593 = type { i32, i32, ptr, [3 x ptr] }
%struct.VecGoto.17.50.83.314.479.842.908.941.974.1040.2028.2127.2160.2595 = type { i32, i32, ptr, [3 x ptr] }
%struct.Goto.16.49.82.313.478.841.907.940.973.1039.2027.2126.2159.2594 = type { ptr, ptr }
%struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597 = type { i32, i32, ptr, [3 x ptr] }
%struct.Action.19.52.85.316.481.844.910.943.976.1042.2030.2129.2162.2596 = type { i32, ptr, ptr, ptr, i32, ptr }
%struct.VecHint.22.55.88.319.484.847.913.946.979.1045.2033.2132.2165.2599 = type { i32, i32, ptr, [3 x ptr] }
%struct.Hint.21.54.87.318.483.846.912.945.978.1044.2032.2131.2164.2598 = type { i32, ptr, ptr }
%struct.Scanner.27.60.93.324.489.852.918.951.984.1050.2038.2137.2170.2604 = type { %struct.VecScanState.25.58.91.322.487.850.916.949.982.1048.2036.2135.2168.2602, %struct.VecScanStateTransition.26.59.92.323.488.851.917.950.983.1049.2037.2136.2169.2603 }
%struct.VecScanState.25.58.91.322.487.850.916.949.982.1048.2036.2135.2168.2602 = type { i32, i32, %struct.ScanState.24.57.90.321.486.849.915.948.981.1047.2035.2134.2167.2601**, [3 x %struct.ScanState.24.57.90.321.486.849.915.948.981.1047.2035.2134.2167.2601*] }
%struct.ScanState.24.57.90.321.486.849.915.948.981.1047.2035.2134.2167.2601 = type { i32, [256 x %struct.ScanState.24.57.90.321.486.849.915.948.981.1047.2035.2134.2167.2601*], %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, [256 x %struct.ScanStateTransition.23.56.89.320.485.848.914.947.980.1046.2034.2133.2166.2600*] }
%struct.VecScanState.25.58.91.322.487.850.916.949.982.1048.2036.2135.2168.2602 = type { i32, i32, ptr, [3 x ptr] }
%struct.ScanState.24.57.90.321.486.849.915.948.981.1047.2035.2134.2167.2601 = type { i32, [256 x ptr], %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, [256 x ptr] }
%struct.ScanStateTransition.23.56.89.320.485.848.914.947.980.1046.2034.2133.2166.2600 = type { i32, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597, %struct.VecAction.20.53.86.317.482.845.911.944.977.1043.2031.2130.2163.2597 }
%struct.VecScanStateTransition.26.59.92.323.488.851.917.950.983.1049.2037.2136.2169.2603 = type { i32, i32, %struct.ScanStateTransition.23.56.89.320.485.848.914.947.980.1046.2034.2133.2166.2600**, [3 x %struct.ScanStateTransition.23.56.89.320.485.848.914.947.980.1046.2034.2133.2166.2600*] }
%struct.VecScanStateTransition.26.59.92.323.488.851.917.950.983.1049.2037.2136.2169.2603 = type { i32, i32, ptr, [3 x ptr] }

; Function Attrs: nounwind
declare noalias i8* @malloc() #0
declare noalias ptr @malloc() #0

; Function Attrs: nounwind uwtable
define void @build_eq() #1 {
entry:
%call = tail call noalias i8* @malloc() #2
%0 = bitcast i8* %call to %struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606*
%call = tail call noalias ptr @malloc() #2
br label %for.cond.preheader

for.cond.preheader: ; preds = %for.cond.preheader, %entry
Expand All @@ -54,30 +53,28 @@ for.cond.400.preheader: ; preds = %for.inc.397, %for.c
br i1 undef, label %for.end.423, label %for.body.405

for.body.321: ; preds = %for.inc.397, %for.cond.316.preheader
%eq329 = getelementptr inbounds %struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606, %struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606* %0, i64 0, i32 0
br i1 undef, label %for.inc.397, label %land.lhs.true.331

land.lhs.true.331: ; preds = %for.body.321
br i1 undef, label %for.inc.397, label %if.then.334

if.then.334: ; preds = %land.lhs.true.331
%1 = load %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605** %eq329, align 8
%2 = load %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588*, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588** undef, align 8
%0 = load ptr, ptr %call, align 8
%1 = load ptr, ptr undef, align 8
br i1 undef, label %for.inc.397, label %land.lhs.true.369

land.lhs.true.369: ; preds = %if.then.334
%n380 = getelementptr inbounds %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588, %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588* %2, i64 0, i32 6, i32 0
%3 = load i32, i32* %n380, align 8
%cmp381 = icmp eq i32 %3, 2
%n380 = getelementptr inbounds %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588, ptr %1, i64 0, i32 6, i32 0
%2 = load i32, ptr %n380, align 8
%cmp381 = icmp eq i32 %2, 2
br i1 %cmp381, label %if.then.383, label %for.inc.397

if.then.383: ; preds = %land.lhs.true.369
%reduces_to385 = getelementptr inbounds %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605* %1, i64 0, i32 14
store %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605* undef, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605** %reduces_to385, align 8
%diff_rule386 = getelementptr inbounds %struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606, %struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606* %0, i64 0, i32 1
%4 = bitcast %struct.Rule.33.66.99.330.495.858.924.957.990.1056.2044.2143.2176.2588** %diff_rule386 to i64*
%5 = load i64, i64* %4, align 8
%6 = load %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605*, %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605** %eq329, align 8
%reduces_to385 = getelementptr inbounds %struct.State.28.61.94.325.490.853.919.952.985.1051.2039.2138.2171.2605, ptr %0, i64 0, i32 14
store ptr undef, ptr %reduces_to385, align 8
%diff_rule386 = getelementptr inbounds %struct.EqState.41.74.107.338.503.866.932.965.998.1064.2052.2151.2184.2606, ptr %call, i64 0, i32 1
%3 = load i64, ptr %diff_rule386, align 8
%4 = load ptr, ptr %call, align 8
br label %for.inc.397

for.inc.397: ; preds = %if.then.383, %land.lhs.true.369, %if.then.334, %land.lhs.true.331, %for.body.321
Expand Down
15 changes: 7 additions & 8 deletions polly/test/CodeGen/invariant-load-dimension.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n8:16:32-S64"
%S = type { i32, i32, [12 x %L] }
%L = type { i32, i32, double, i32, i32, i32, i32, i32 }

define void @test(%S* %cpi, i1 %b) {
define void @test(ptr %cpi, i1 %b) {
; SCOPS-LABEL: Region: %if.then14---%exit
; SCOPS: Invariant Accesses: {
; SCOPS-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
Expand All @@ -26,26 +26,25 @@ define void @test(%S* %cpi, i1 %b) {
; CODEGEN-NEXT: br i1 false

entry:
%nt = getelementptr inbounds %S, %S* %cpi, i32 0, i32 1
%nt = getelementptr inbounds %S, ptr %cpi, i32 0, i32 1
br i1 %b, label %if.then14, label %exit

if.then14:
%ns = getelementptr inbounds %S, %S* %cpi, i32 0, i32 0
%l0 = load i32, i32* %ns, align 8
%l0 = load i32, ptr %cpi, align 8
%cmp12.i = icmp sgt i32 %l0, 0
br i1 %cmp12.i, label %for.body.lr.ph.i, label %exit

for.body.lr.ph.i:
%l1 = load i32, i32* %nt, align 4
%l1 = load i32, ptr %nt, align 4
br label %for.body.i

for.body.i:
%phi = phi i32 [ 0, %for.body.lr.ph.i ], [ %inc, %for.body.i ]
%mul.i163 = mul nsw i32 %phi, %l1
%cv = getelementptr inbounds %S, %S* %cpi, i32 0, i32 2, i32 %mul.i163, i32 0
store i32 0, i32* %cv, align 8
%cv = getelementptr inbounds %S, ptr %cpi, i32 0, i32 2, i32 %mul.i163, i32 0
store i32 0, ptr %cv, align 8
%inc = add nuw nsw i32 %phi, 1
%l2 = load i32, i32* %ns, align 8
%l2 = load i32, ptr %cpi, align 8
%cmp.i164 = icmp slt i32 %inc, %l2
br i1 %cmp.i164, label %for.body.i, label %exit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

@TOP = external global i64*, align 8
@BOT = external global i64*, align 8
@TOP = external global ptr, align 8
@BOT = external global ptr, align 8

define void @RemoveConstraintVCG() {
entry:
Expand All @@ -28,38 +28,38 @@ land.lhs.true: ; preds = %for.body.11
br i1 undef, label %if.then.20, label %for.inc

if.then.20: ; preds = %land.lhs.true
%tmp = load i64*, i64** @TOP, align 8
%tmp1 = load i64, i64* %tmp, align 8
%tmp = load ptr, ptr @TOP, align 8
%tmp1 = load i64, ptr %tmp, align 8
%cmp25 = icmp eq i64 %tmp1, 1
%cmp47 = icmp eq i64 %tmp1, 0
br i1 false, label %if.end.117, label %lor.lhs.false.85

lor.lhs.false.85: ; preds = %if.then.20
%add94 = add i64 %tmp1, 1
%tmp2 = load i64*, i64** @TOP, align 8
%arrayidx95 = getelementptr inbounds i64, i64* %tmp2, i64 %add94
%tmp3 = load i64, i64* %arrayidx95, align 8
%tmp2 = load ptr, ptr @TOP, align 8
%arrayidx95 = getelementptr inbounds i64, ptr %tmp2, i64 %add94
%tmp3 = load i64, ptr %arrayidx95, align 8
br i1 false, label %if.else.103, label %land.lhs.true.97

land.lhs.true.97: ; preds = %lor.lhs.false.85
%tmp4 = load i64*, i64** @BOT, align 8
%arrayidx99 = getelementptr inbounds i64, i64* %tmp4, i64 %add94
%tmp5 = load i64, i64* %arrayidx99, align 8
%tmp4 = load ptr, ptr @BOT, align 8
%arrayidx99 = getelementptr inbounds i64, ptr %tmp4, i64 %add94
%tmp5 = load i64, ptr %arrayidx99, align 8
%tobool100 = icmp eq i64 %tmp5, 0
br i1 %tobool100, label %if.else.103, label %if.then.101

if.then.101: ; preds = %land.lhs.true.97
br label %if.end.117

if.else.103: ; preds = %land.lhs.true.97, %lor.lhs.false.85
%tmp6 = load i64*, i64** @TOP, align 8
%arrayidx105 = getelementptr inbounds i64, i64* %tmp6, i64 %add94
%tmp7 = load i64, i64* %arrayidx105, align 8
%tmp6 = load ptr, ptr @TOP, align 8
%arrayidx105 = getelementptr inbounds i64, ptr %tmp6, i64 %add94
%tmp7 = load i64, ptr %arrayidx105, align 8
br i1 false, label %lor.lhs.false.107, label %if.else.112

lor.lhs.false.107: ; preds = %if.else.103
%tmp8 = load i64*, i64** @BOT, align 8
%arrayidx109 = getelementptr inbounds i64, i64* %tmp8, i64 %add94
%tmp8 = load ptr, ptr @BOT, align 8
%arrayidx109 = getelementptr inbounds i64, ptr %tmp8, i64 %add94
br i1 false, label %if.end.117, label %if.else.112

if.else.112: ; preds = %lor.lhs.false.107, %if.else.103
Expand Down
15 changes: 6 additions & 9 deletions polly/test/CodeGen/invariant_cannot_handle_void.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
; SCOP: }
;
; CHECK-LABEL: polly.preload.begin:
; CHECK-NEXT: %polly.access.cast.buff = bitcast i8* %buff to i16*
; CHECK-NEXT: %polly.access.buff = getelementptr i16, i16* %polly.access.cast.buff, i64 31
; CHECK-NEXT: %polly.access.buff.cast = bitcast i16* %polly.access.buff to i32*
; CHECK-NEXT: %polly.access.buff.load = load i32, i32* %polly.access.buff.cast, align 4
; CHECK-NEXT: store i32 %polly.access.buff.load, i32* %tmp1.preload.s2a
; CHECK-NEXT: %polly.access.buff = getelementptr i16, ptr %buff, i64 31
; CHECK-NEXT: %polly.access.buff.load = load i32, ptr %polly.access.buff, align 4
; CHECK-NEXT: store i32 %polly.access.buff.load, ptr %tmp1.preload.s2a
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

; Function Attrs: nounwind uwtable
define void @sudecrypt(i8* %buff) #0 {
define void @sudecrypt(ptr %buff) #0 {
entry:
br i1 undef, label %cleanup, label %if.end

Expand All @@ -37,9 +35,8 @@ if.then.5: ; preds = %if.end
unreachable

if.end.6: ; preds = %if.end
%add.ptr = getelementptr inbounds i8, i8* %buff, i64 62
%tmp = bitcast i8* %add.ptr to i32*
%tmp1 = load i32, i32* %tmp, align 4, !tbaa !1
%add.ptr = getelementptr inbounds i8, ptr %buff, i64 62
%tmp1 = load i32, ptr %add.ptr, align 4, !tbaa !1
br i1 false, label %if.then.13, label %switch.early.test

switch.early.test: ; preds = %if.end.6
Expand Down
8 changes: 4 additions & 4 deletions polly/test/CodeGen/invariant_load_alias_metadata.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; This test case checks whether Polly generates alias metadata in case of
; the ublas gemm kernel and polly-invariant-load-hoisting.
;
; CHECK: store float 4.200000e+01, float* %polly.access.A.load, align 4, !alias.scope !3, !noalias !0
; CHECK: store float 4.200000e+01, ptr %polly.access.A.load, align 4, !alias.scope !3, !noalias !0
;
; CHECK: !0 = !{!1}
; CHECK-NEXT: !1 = distinct !{!1, !2, !"polly.alias.scope.MemRef_A"}
Expand All @@ -15,15 +15,15 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define void @nometadata(float** %A) {
define void @nometadata(ptr %A) {
entry:
br label %for

for:
%indvar = phi i64 [0, %entry], [%indvar.next, %for]
%indvar.next = add i64 %indvar, 1
%ptrA = load float*, float** %A
store float 42.0, float* %ptrA
%ptrA = load ptr, ptr %A
store float 42.0, ptr %ptrA
%icmp = icmp sle i64 %indvar, 1024
br i1 %icmp, label %for, label %exit

Expand Down
15 changes: 7 additions & 8 deletions polly/test/CodeGen/invariant_load_different_sized_types.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

; CHECK: polly.preload.begin: ; preds = %polly.split_new_and_old
; CHECK-NEXT: %polly.access.cast.tmp2 = bitcast %struct.hoge* %tmp2 to i32*
; CHECK-NEXT: %polly.access.tmp2 = getelementptr i32, i32* %polly.access.cast.tmp2, i64 1
; CHECK-NEXT: %polly.access.tmp2.load = load i32, i32* %polly.access.tmp2, align 1
; CHECK-NEXT: store i32 %polly.access.tmp2.load, i32* %tmp.preload.s2a
; CHECK-NEXT: %polly.access.tmp2 = getelementptr i32, ptr %tmp2, i64 1
; CHECK-NEXT: %polly.access.tmp2.load = load i32, ptr %polly.access.tmp2, align 1
; CHECK-NEXT: store i32 %polly.access.tmp2.load, ptr %tmp.preload.s2a


%struct.hoge = type { [4 x i8], i32, i32, i32, i32, i32, [16 x i8], [16 x i8], i64, i64, i64, i64, i64 }
Expand All @@ -19,15 +18,15 @@ bb:
br label %bb3

bb3: ; preds = %bb
%tmp4 = getelementptr inbounds %struct.hoge, %struct.hoge* %tmp2, i64 0, i32 10
%tmp4 = getelementptr inbounds %struct.hoge, ptr %tmp2, i64 0, i32 10
%tmp5 = add nsw i32 undef, 1
%tmp6 = getelementptr inbounds %struct.hoge, %struct.hoge* %tmp2, i64 0, i32 1
%tmp = load i32, i32* %tmp6, align 1, !tbaa !1
%tmp6 = getelementptr inbounds %struct.hoge, ptr %tmp2, i64 0, i32 1
%tmp = load i32, ptr %tmp6, align 1, !tbaa !1
%tmp7 = icmp slt i32 %tmp, 3
br i1 %tmp7, label %bb8, label %bb10

bb8: ; preds = %bb3
%tmp9 = load i64, i64* %tmp4, align 1, !tbaa !7
%tmp9 = load i64, ptr %tmp4, align 1, !tbaa !7
br label %bb10

bb10: ; preds = %bb8, %bb3
Expand Down
16 changes: 8 additions & 8 deletions polly/test/CodeGen/invariant_load_escaping_second_scop.ll
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A, i32* %B) {
define void @f(ptr %A, ptr %B) {
entry:
br label %stmt.S

stmt.S: ; preds = %do.cond, %entry
%indvars.iv2 = phi i64 [ %indvars.iv.next3, %do.cond ], [ 0, %entry ]
%tmp = load i32, i32* %B, align 4
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv2
%tmp4 = load i32, i32* %arrayidx, align 4
%tmp = load i32, ptr %B, align 4
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv2
%tmp4 = load i32, ptr %arrayidx, align 4
%add = add nsw i32 %tmp4, %tmp
store i32 %add, i32* %arrayidx, align 4
store i32 %add, ptr %arrayidx, align 4
br label %do.cond

do.cond: ; preds = %do.body
Expand All @@ -49,10 +49,10 @@ do.end: ; preds = %do.cond

stmt.P: ; preds = %do.cond.5, %do.end
%indvars.iv = phi i64 [ %indvars.iv.next, %do.cond.5 ], [ %tmp6, %do.end ]
%arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
%tmp7 = load i32, i32* %arrayidx3, align 4
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%tmp7 = load i32, ptr %arrayidx3, align 4
%inc4 = add nsw i32 %tmp7, 1
store i32 %inc4, i32* %arrayidx3, align 4
store i32 %inc4, ptr %arrayidx3, align 4
br label %do.cond.5

do.cond.5: ; preds = %do.body.1
Expand Down
8 changes: 4 additions & 4 deletions polly/test/CodeGen/invariant_load_loop_ub.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A, i32* %UB) {
define void @f(ptr %A, ptr %UB) {
bb:
br label %bb1

bb1: ; preds = %bb6, %bb
%indvars.iv = phi i64 [ %indvars.iv.next, %bb6 ], [ 0, %bb ]
%tmp = load i32, i32* %UB, align 4
%tmp = load i32, ptr %UB, align 4
%tmp2 = sext i32 %tmp to i64
%tmp3 = icmp slt i64 %indvars.iv, %tmp2
br i1 %tmp3, label %bb4, label %bb7

bb4: ; preds = %bb1
%tmp5 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
store i32 0, i32* %tmp5, align 4
%tmp5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
store i32 0, ptr %tmp5, align 4
br label %bb6

bb6: ; preds = %bb4
Expand Down
52 changes: 26 additions & 26 deletions polly/test/CodeGen/invariant_load_not_executed_but_in_parameters.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

%struct.Exp.204.248.358 = type { %struct.Exp_.200.244.354*, i32, i32, i32, %struct.Exp.204.248.358*, %struct.Exp.204.248.358*, %union.anon.2.201.245.355, %union.anon.3.202.246.356, %union.anon.4.203.247.357 }
%struct.Exp_.200.244.354 = type { i32, i32, i32, i32, %struct.Id.199.243.353* }
%struct.Id.199.243.353 = type { i8*, i32, i32, i32, %union.anon.1.198.242.352 }
%struct.Exp.204.248.358 = type { ptr, i32, i32, i32, ptr, ptr, %union.anon.2.201.245.355, %union.anon.3.202.246.356, %union.anon.4.203.247.357 }
%struct.Exp_.200.244.354 = type { i32, i32, i32, i32, ptr }
%struct.Id.199.243.353 = type { ptr, i32, i32, i32, %union.anon.1.198.242.352 }
%union.anon.1.198.242.352 = type { [2 x i64] }
%union.anon.2.201.245.355 = type { %struct.Exp.204.248.358* }
%union.anon.2.201.245.355 = type { ptr }
%union.anon.3.202.246.356 = type { i32 }
%union.anon.4.203.247.357 = type { %struct.Exp.204.248.358** }
%struct.Classfile.218.262.372 = type { %struct._IO_FILE.206.250.360*, %struct._IO_FILE.206.250.360*, i32, i32, i32, %struct.ClassVersion.207.251.361, %struct.ConstPool.210.254.364, %struct.AccessFlags.211.255.365, i16, i8*, i8*, i16, i8*, i16, i16*, i16, %struct.field_info.212.256.366**, i16, %struct.method_info.217.261.371**, i8*, i16, i8**, i8* }
%struct._IO_FILE.206.250.360 = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker.205.249.359*, %struct._IO_FILE.206.250.360*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker.205.249.359 = type { %struct._IO_marker.205.249.359*, %struct._IO_FILE.206.250.360*, i32 }
%union.anon.4.203.247.357 = type { ptr }
%struct.Classfile.218.262.372 = type { ptr, ptr, i32, i32, i32, %struct.ClassVersion.207.251.361, %struct.ConstPool.210.254.364, %struct.AccessFlags.211.255.365, i16, ptr, ptr, i16, ptr, i16, ptr, i16, ptr, i16, ptr, ptr, i16, ptr, ptr }
%struct._IO_FILE.206.250.360 = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
%struct._IO_marker.205.249.359 = type { ptr, ptr, i32 }
%struct.ClassVersion.207.251.361 = type { i16, i16 }
%struct.ConstPool.210.254.364 = type { i16, %struct.cp_info.209.253.363* }
%struct.ConstPool.210.254.364 = type { i16, ptr }
%struct.cp_info.209.253.363 = type { i8, %union.anon.208.252.362 }
%union.anon.208.252.362 = type { i64 }
%struct.AccessFlags.211.255.365 = type { i16 }
%struct.field_info.212.256.366 = type <{ %struct.AccessFlags.211.255.365, [6 x i8], i8*, i8*, i32, i16, [2 x i8] }>
%struct.method_info.217.261.371 = type { %struct.AccessFlags.211.255.365, i8*, i8*, i8, i8, i32, i8*, i16, %struct.Block.214.258.368*, i16, %struct.LineNumberTableEntry.215.259.369*, i16, %struct.LocalVariableTableEntry.216.260.370*, i8**, i8**, i32*, i32*, i8*, i32, i32, i32* }
%struct.Block.214.258.368 = type { i32, i16, i16, %union.anon.0.213.257.367, i16, %struct.Exp.204.248.358* }
%struct.field_info.212.256.366 = type <{ %struct.AccessFlags.211.255.365, [6 x i8], ptr, ptr, i32, i16, [2 x i8] }>
%struct.method_info.217.261.371 = type { %struct.AccessFlags.211.255.365, ptr, ptr, i8, i8, i32, ptr, i16, ptr, i16, ptr, i16, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr }
%struct.Block.214.258.368 = type { i32, i16, i16, %union.anon.0.213.257.367, i16, ptr }
%union.anon.0.213.257.367 = type { i32 }
%struct.LineNumberTableEntry.215.259.369 = type { i16, i16 }
%struct.LocalVariableTableEntry.216.260.370 = type { i16, i16, i16, i16, i16 }
%struct.Case.219.263.373 = type { i64, i64 }

@currpc = external global i32, align 4
@bufflength = external global i32, align 4
@inbuff = external global i8*, align 8
@stkptr = external global %struct.Exp.204.248.358**, align 8
@donestkptr = external global %struct.Exp.204.248.358**, align 8
@inbuff = external global ptr, align 8
@stkptr = external global ptr, align 8
@donestkptr = external global ptr, align 8

; Function Attrs: uwtable
define i32 @_Z13dotableswitchP9Classfile(%struct.Classfile.218.262.372* %c) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
define i32 @_Z13dotableswitchP9Classfile(ptr %c) #0 personality ptr @__gxx_personality_v0 {
entry:
br label %entry.split

Expand All @@ -48,7 +48,7 @@ while.body.lr.ph: ; preds = %entry.split
br label %while.body

while.body: ; preds = %while.body, %while.body.lr.ph
%0 = load i32, i32* @currpc, align 4
%0 = load i32, ptr @currpc, align 4
%rem = and i32 %0, 3
%tobool = icmp eq i32 %rem, 0
br i1 %tobool, label %while.cond.while.end_crit_edge, label %while.body
Expand All @@ -57,7 +57,7 @@ while.cond.while.end_crit_edge: ; preds = %while.body
br label %while.end

while.end: ; preds = %while.cond.while.end_crit_edge, %entry.split
invoke void @_ZN3ExpC2Ejj7Exptype4Type2OpPS_jjP4Case(%struct.Exp.204.248.358* nonnull undef, i32 %sub, i32 undef, i32 9, i32 0, i32 39, %struct.Exp.204.248.358* undef, i32 undef, i32 undef, %struct.Case.219.263.373* nonnull undef)
invoke void @_ZN3ExpC2Ejj7Exptype4Type2OpPS_jjP4Case(ptr nonnull undef, i32 %sub, i32 undef, i32 9, i32 0, i32 39, ptr undef, i32 undef, i32 undef, ptr nonnull undef)
to label %invoke.cont unwind label %lpad

invoke.cont: ; preds = %while.end
Expand All @@ -70,9 +70,9 @@ for.body: ; preds = %for.body, %for.body
br i1 undef, label %for.cond.for.end_crit_edge, label %for.body

lpad: ; preds = %while.end
%1 = landingpad { i8*, i32 }
%1 = landingpad { ptr, i32 }
cleanup
resume { i8*, i32 } undef
resume { ptr, i32 } undef

for.cond.for.end_crit_edge: ; preds = %for.body
br label %for.end
Expand All @@ -85,24 +85,24 @@ for.end: ; preds = %for.cond.for.end_cr
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin
declare noalias i8* @_Znam(i64) #2
declare noalias ptr @_Znam(i64) #2

; Function Attrs: nobuiltin
declare noalias i8* @_Znwm(i64) #2
declare noalias ptr @_Znwm(i64) #2

; Function Attrs: uwtable
declare void @_ZN3ExpC2Ejj7Exptype4Type2OpPS_jjP4Case(%struct.Exp.204.248.358*, i32, i32, i32, i32, i32, %struct.Exp.204.248.358*, i32, i32, %struct.Case.219.263.373*) unnamed_addr #0 align 2
declare void @_ZN3ExpC2Ejj7Exptype4Type2OpPS_jjP4Case(ptr, i32, i32, i32, i32, i32, ptr, i32, i32, ptr) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPv(i8*) #3
declare void @_ZdlPv(ptr) #3

; Function Attrs: uwtable
declare i32 @_Z10doluswitchP9Classfile(%struct.Classfile.218.262.372*) #0
declare i32 @_Z10doluswitchP9Classfile(ptr) #0

; Function Attrs: nounwind uwtable
declare void @_ZN4Exp_C2E7Exptype4Type2Op(%struct.Exp_.200.244.354*, i32, i32, i32) unnamed_addr #4 align 2
declare void @_ZN4Exp_C2E7Exptype4Type2Op(ptr, i32, i32, i32) unnamed_addr #4 align 2

attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
Expand Down
10 changes: 5 additions & 5 deletions polly/test/CodeGen/invariant_load_outermost.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @f(i32* %A) {
define void @f(ptr %A) {
entry:
br label %entry.split

entry.split:
%tmp = load i32, i32* %A, align 4
%tmp = load i32, ptr %A, align 4
%cmp = icmp sgt i32 %tmp, 42
br i1 %cmp, label %if.then, label %if.else

if.then: ; preds = %entry
%tmp1 = load i32, i32* %A, align 4
%tmp1 = load i32, ptr %A, align 4
%add = add nsw i32 %tmp1, 1
br label %if.end

if.else: ; preds = %entry
%tmp2 = load i32, i32* %A, align 4
%tmp2 = load i32, ptr %A, align 4
%sub = add nsw i32 %tmp2, -1
br label %if.end

if.end: ; preds = %if.else, %if.then
%storemerge = phi i32 [ %sub, %if.else ], [ %add, %if.then ]
store i32 %storemerge, i32* %A, align 4
store i32 %storemerge, ptr %A, align 4
ret void
}
24 changes: 12 additions & 12 deletions polly/test/CodeGen/invariant_load_scalar_escape_alloca_sharing.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
; CHECK: %tmp0.preload.s2a = alloca i32
; CHECK-NOT: alloca
;
; CHECK: %ncol.load = load i32, i32* @ncol
; CHECK-NEXT: store i32 %ncol.load, i32* %tmp0.preload.s2a
; CHECK: %ncol.load = load i32, ptr @ncol
; CHECK-NEXT: store i32 %ncol.load, ptr %tmp0.preload.s2a
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

@ncol = external global i32, align 4

define void @melt_data(i32* %data1, i32* %data2) {
define void @melt_data(ptr %data1, ptr %data2) {
entry:
br label %entry.split

entry.split: ; preds = %entry
%tmp0 = load i32, i32* @ncol, align 4
%tmp0 = load i32, ptr @ncol, align 4
%tobool.2 = icmp eq i32 %tmp0, 0
br i1 %tobool.2, label %while.end, label %while.body.lr.ph

Expand All @@ -31,21 +31,21 @@ while.body: ; preds = %while.body.lr.ph, %
%dec3.in = phi i32 [ %tmp0, %while.body.lr.ph ], [ %dec3, %while.cond.backedge ]
%dec3 = add nsw i32 %dec3.in, -1
%idxprom = sext i32 %dec3 to i64
%arrayidx = getelementptr inbounds i32, i32* %data1, i64 %idxprom
%tmp1 = load i32, i32* %arrayidx, align 4
%arrayidx = getelementptr inbounds i32, ptr %data1, i64 %idxprom
%tmp1 = load i32, ptr %arrayidx, align 4
%idxprom1 = sext i32 %dec3 to i64
%arrayidx2 = getelementptr inbounds i32, i32* %data2, i64 %idxprom1
%tmp2 = load i32, i32* %arrayidx2, align 4
%arrayidx2 = getelementptr inbounds i32, ptr %data2, i64 %idxprom1
%tmp2 = load i32, ptr %arrayidx2, align 4
%cmp = icmp sgt i32 %tmp1, %tmp2
br i1 %cmp, label %if.then, label %while.cond.backedge

if.then: ; preds = %while.body
%idxprom3 = sext i32 %dec3 to i64
%arrayidx4 = getelementptr inbounds i32, i32* %data2, i64 %idxprom3
%tmp3 = load i32, i32* %arrayidx4, align 4
%arrayidx4 = getelementptr inbounds i32, ptr %data2, i64 %idxprom3
%tmp3 = load i32, ptr %arrayidx4, align 4
%idxprom5 = sext i32 %dec3 to i64
%arrayidx6 = getelementptr inbounds i32, i32* %data1, i64 %idxprom5
store i32 %tmp3, i32* %arrayidx6, align 4
%arrayidx6 = getelementptr inbounds i32, ptr %data1, i64 %idxprom5
store i32 %tmp3, ptr %arrayidx6, align 4
br label %while.cond.backedge

while.cond.backedge: ; preds = %if.then, %while.body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
;
target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"

%struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90 = type { i32, float, i32*, float* }
%struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90 = type { i32, float, ptr, ptr }

; Function Attrs: nounwind ssp
define void @ff_iir_filter(%struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90* %c, i16* %dst, i32 %dstep) #0 {
define void @ff_iir_filter(ptr %c, ptr %dst, i32 %dstep) #0 {
entry:
br i1 undef, label %if.end.325, label %for.body.38

for.body.38: ; preds = %for.body.38, %entry
%dst034.0180 = phi i16* [ undef, %for.body.38 ], [ %dst, %entry ]
%gain42 = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90, %struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90* %c, i32 0, i32 1
%cy44 = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90, %struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90* %c, i32 0, i32 3
%add.ptr88 = getelementptr inbounds i16, i16* %dst034.0180, i32 %dstep
store i16 undef, i16* %add.ptr88, align 2
%0 = load float, float* %gain42, align 4
%1 = load float*, float** %cy44, align 4
%dst034.0180 = phi ptr [ undef, %for.body.38 ], [ %dst, %entry ]
%gain42 = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90, ptr %c, i32 0, i32 1
%cy44 = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.12.15.27.36.54.57.84.87.90, ptr %c, i32 0, i32 3
%add.ptr88 = getelementptr inbounds i16, ptr %dst034.0180, i32 %dstep
store i16 undef, ptr %add.ptr88, align 2
%0 = load float, ptr %gain42, align 4
%1 = load ptr, ptr %cy44, align 4
br i1 false, label %for.body.38, label %if.end.325

if.end.325: ; preds = %for.body.38, %entry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
;
target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"

%struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171 = type { i32, float, i32*, float* }
%struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171 = type { i32, float, ptr, ptr }

; Function Attrs: nounwind ssp
define void @butterworth_init_coeffs(%struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171* %c) #0 {
define void @butterworth_init_coeffs(ptr %c) #0 {
entry:
br i1 undef, label %if.end, label %if.then

Expand All @@ -28,13 +28,13 @@ for.body.35: ; preds = %if.end.2
unreachable

for.end.126: ; preds = %if.end.2
%gain = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171, %struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171* %c, i32 0, i32 1
%gain = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171, ptr %c, i32 0, i32 1
br i1 undef, label %for.body.133, label %for.end.169

for.body.133: ; preds = %for.body.133, %for.end.126
store float undef, float* %gain, align 4
%cy = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171, %struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171* %c, i32 0, i32 3
%0 = load float*, float** %cy, align 4
store float undef, ptr %gain, align 4
%cy = getelementptr inbounds %struct.FFIIRFilterCoeffs.0.3.6.63.78.81.87.102.150.162.165.168.171, ptr %c, i32 0, i32 3
%0 = load ptr, ptr %cy, align 4
br i1 false, label %for.body.133, label %for.end.169

for.end.169: ; preds = %for.body.133, %for.end.126
Expand Down
12 changes: 6 additions & 6 deletions polly/test/CodeGen/invariant_loads_ignore_parameter_bounds.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
; RUN: -polly-ignore-parameter-bounds -S < %s | FileCheck %s

; CHECK: polly.preload.begin:
; CHECK-NEXT: %global.load = load i32, i32* @global, align 4, !alias.scope !0, !noalias !3
; CHECK-NEXT: store i32 %global.load, i32* %tmp24.preload.s2a
; CHECK-NEXT: %global.load = load i32, ptr @global, align 4, !alias.scope !0, !noalias !3
; CHECK-NEXT: store i32 %global.load, ptr %tmp24.preload.s2a

target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"

Expand All @@ -15,20 +15,20 @@ bb:
br label %bb18

bb18: ; preds = %bb16
%tmp19 = load i32, i32* @global, align 4
%tmp19 = load i32, ptr @global, align 4
br label %bb20

bb20: ; preds = %bb21, %bb18
%tmp22 = icmp eq i32 0, %tmp19
br i1 %tmp22, label %bb23, label %bb20

bb23: ; preds = %bb21
%tmp24 = load i32, i32* @global, align 4
%tmp24 = load i32, ptr @global, align 4
%tmp25 = add i32 %tmp24, 1
%tmp26 = sext i32 %tmp25 to i64
%tmp27 = add nsw i64 %tmp26, -1
%tmp28 = getelementptr [4 x double], [4 x double]* %tmp, i64 0, i64 %tmp27
store double undef, double* %tmp28
%tmp28 = getelementptr [4 x double], ptr %tmp, i64 0, i64 %tmp27
store double undef, ptr %tmp28
br label %bb29

bb29: ; preds = %bb23
Expand Down
6 changes: 3 additions & 3 deletions polly/test/CodeGen/invariant_verify_function_failed.ll
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if.end: ; preds = %entry
br i1 undef, label %land.lhs.true, label %if.end.18

land.lhs.true: ; preds = %if.end
%call9 = tail call i32* @__errno_location() #2
%tmp = load i32, i32* %call9, align 4, !tbaa !1
%call9 = tail call ptr @__errno_location() #2
%tmp = load i32, ptr %call9, align 4, !tbaa !1
br i1 false, label %if.then.12, label %if.end.18

if.then.12: ; preds = %land.lhs.true
Expand All @@ -45,7 +45,7 @@ cleanup: ; preds = %if.end.27, %entry
}

; Function Attrs: nounwind readnone
declare i32* @__errno_location() #1
declare ptr @__errno_location() #1

attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
Expand Down
32 changes: 15 additions & 17 deletions polly/test/CodeGen/invariant_verify_function_failed_2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s = type { i32, i32, i32, i32, i32, i32, [6 x [33 x i64]], [6 x [33 x i64]], [6 x [33 x i64]], [6 x [33 x i64]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16**, i16*, i16*, i16**, i16**, i16***, i8*, i16***, i64***, i64***, i16****, i8**, i8**, %struct.s*, %struct.s*, %struct.s*, i32, i32, i32, i32, i32, i32, i32 }
%struct.s = type { i32, i32, i32, i32, i32, i32, [6 x [33 x i64]], [6 x [33 x i64]], [6 x [33 x i64]], [6 x [33 x i64]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32 }

@enc_picture = external global %struct.s*, align 8
@enc_picture = external global ptr, align 8

; Function Attrs: nounwind uwtable
define void @compute_colocated(%struct.s*** %listX, i1* %A, i32* %B) #0 {
define void @compute_colocated(ptr %listX, ptr %A, ptr %B) #0 {
entry:
br label %for.body2414

Expand All @@ -52,28 +52,26 @@ if.else2454: ; preds = %for.body2414
br i1 %cmp2455, label %if.then2457, label %if.else2493

if.then2457: ; preds = %if.else2454
%arrayidx2461 = getelementptr inbounds %struct.s**, %struct.s*** %listX, i64 %indvars.iv902
%tmp1 = load %struct.s**, %struct.s*** %arrayidx2461, align 8, !tbaa !1
%arrayidx2462 = getelementptr inbounds %struct.s*, %struct.s** %tmp1, i64 0
%tmp2 = load %struct.s*, %struct.s** %arrayidx2462, align 8, !tbaa !1
%poc2463 = getelementptr inbounds %struct.s, %struct.s* %tmp2, i64 0, i32 1
%tmp3 = load i32, i32* %poc2463, align 4, !tbaa !5
%arrayidx2461 = getelementptr inbounds ptr, ptr %listX, i64 %indvars.iv902
%tmp1 = load ptr, ptr %arrayidx2461, align 8, !tbaa !1
%tmp2 = load ptr, ptr %tmp1, align 8, !tbaa !1
%poc2463 = getelementptr inbounds %struct.s, ptr %tmp2, i64 0, i32 1
%tmp3 = load i32, ptr %poc2463, align 4, !tbaa !5
%sub2464 = sub nsw i32 0, %tmp3
br label %cond.false2468

cond.false2468: ; preds = %if.then2457
%cmp2477 = icmp sgt i32 %sub2464, 127
store i1 %cmp2477, i1* %A
store i1 %cmp2477, ptr %A
br label %for.inc2621

if.else2493: ; preds = %if.else2454
%arrayidx2497 = getelementptr inbounds %struct.s**, %struct.s*** %listX, i64 %indvars.iv902
%tmp4 = load %struct.s**, %struct.s*** %arrayidx2497, align 8, !tbaa !1
%arrayidx2498 = getelementptr inbounds %struct.s*, %struct.s** %tmp4, i64 0
%tmp5 = load %struct.s*, %struct.s** %arrayidx2498, align 8, !tbaa !1
%poc2499 = getelementptr inbounds %struct.s, %struct.s* %tmp5, i64 0, i32 1
%tmp6 = load i32, i32* %poc2499, align 4, !tbaa !5
store i32 %tmp6, i32* %B
%arrayidx2497 = getelementptr inbounds ptr, ptr %listX, i64 %indvars.iv902
%tmp4 = load ptr, ptr %arrayidx2497, align 8, !tbaa !1
%tmp5 = load ptr, ptr %tmp4, align 8, !tbaa !1
%poc2499 = getelementptr inbounds %struct.s, ptr %tmp5, i64 0, i32 1
%tmp6 = load i32, ptr %poc2499, align 4, !tbaa !5
store i32 %tmp6, ptr %B
br label %for.inc2621

for.inc2621: ; preds = %if.else2493, %cond.false2468
Expand Down
10 changes: 5 additions & 5 deletions polly/test/CodeGen/large-numbers-in-boundary-context.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ target triple = "x86_64-unknown-linux-gnu"
@global1 = external global i32, align 4

; Function Attrs: nounwind uwtable
define void @hoge(i8* %arg) #0 {
define void @hoge(ptr %arg) #0 {
bb:
br label %bb5

bb5: ; preds = %bb
%tmp = load i32, i32* @global, align 4
%tmp = load i32, ptr @global, align 4
%tmp6 = sext i32 %tmp to i64
br label %bb11

bb7: ; preds = %bb19
%tmp8 = load i32, i32* @global1, align 4
%tmp8 = load i32, ptr @global1, align 4
%tmp9 = sext i32 %tmp8 to i64
%tmp10 = icmp slt i64 %tmp13, %tmp9
br i1 %tmp10, label %bb11, label %bb20

bb11: ; preds = %bb7, %bb5
%tmp12 = phi i64 [ %tmp6, %bb5 ], [ %tmp13, %bb7 ]
%tmp13 = add i64 %tmp12, 1
%tmp14 = getelementptr inbounds i8, i8* %arg, i64 %tmp13
%tmp15 = load i8, i8* %tmp14, align 1
%tmp14 = getelementptr inbounds i8, ptr %arg, i64 %tmp13
%tmp15 = load i8, ptr %tmp14, align 1
br i1 false, label %bb16, label %bb17

bb16: ; preds = %bb11
Expand Down
11 changes: 4 additions & 7 deletions polly/test/CodeGen/loop-invariant-load-type-mismatch.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu"

; Just make sure this test passes correctly.

define void @kernel_ludcmp(double* %b, double* %y) #0 {
define void @kernel_ludcmp(ptr %b, ptr %y) #0 {
entry:
br label %entry.split

Expand Down Expand Up @@ -71,15 +71,12 @@ for.end.54: ; preds = %for.cond.38.for.end
br i1 false, label %for.body.32, label %for.cond.30.for.cond.loopexit_crit_edge

for.end.65: ; preds = %for.cond.loopexit
%tmp1 = bitcast double* %b to i64*
%tmp2 = load i64, i64* %tmp1, align 8, !tbaa !1
%tmp3 = bitcast double* %y to i64*
store i64 %tmp2, i64* %tmp3, align 8, !tbaa !1
%tmp2 = load i64, ptr %b, align 8, !tbaa !1
store i64 %tmp2, ptr %y, align 8, !tbaa !1
br label %for.body.70

for.body.70: ; preds = %for.end.86, %for.end.65
%arrayidx72 = getelementptr inbounds double, double* %b, i64 0
%tmp4 = load double, double* %arrayidx72, align 8, !tbaa !1
%tmp4 = load double, ptr %b, align 8, !tbaa !1
br i1 true, label %for.body.75.lr.ph, label %for.end.86

for.body.75.lr.ph: ; preds = %for.body.70
Expand Down
30 changes: 15 additions & 15 deletions polly/test/CodeGen/loop_with_condition.ll
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

target 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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"

@A = common global [1024 x i32] zeroinitializer, align 16 ; <[1024 x i32]*> [#uses=4]
@B = common global [1024 x i32] zeroinitializer, align 16 ; <[1024 x i32]*> [#uses=4]
@A = common global [1024 x i32] zeroinitializer, align 16 ; <ptr> [#uses=4]
@B = common global [1024 x i32] zeroinitializer, align 16 ; <ptr> [#uses=4]

define void @loop_with_condition() nounwind {
bb0:
Expand All @@ -51,8 +51,8 @@ bb0:

bb1:
%indvar = phi i64 [ %indvar.next, %bb7 ], [ 0, %bb0 ] ; <i64> [#uses=5]
%scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar ; <i32*> [#uses=2]
%scevgep1 = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar ; <i32*> [#uses=1]
%scevgep = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar ; <ptr> [#uses=2]
%scevgep1 = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar ; <ptr> [#uses=1]
%i.0 = trunc i64 %indvar to i32 ; <i32> [#uses=1]
%exitcond = icmp ne i64 %indvar, 1024 ; <i1> [#uses=1]
br i1 %exitcond, label %bb2, label %bb8
Expand All @@ -62,15 +62,15 @@ bb2:
br i1 %var3, label %bb4, label %bb5

bb4:
store i32 1, i32* %scevgep
store i32 1, ptr %scevgep
br label %bb6

bb5:
store i32 2, i32* %scevgep
store i32 2, ptr %scevgep
br label %bb6

bb6:
store i32 3, i32* %scevgep1
store i32 3, ptr %scevgep1
br label %bb7

bb7:
Expand All @@ -84,20 +84,20 @@ bb8:

define i32 @main() nounwind {
; <label>:0
call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @A to i8*), i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @B to i8*), i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0.i64(ptr @A, i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0.i64(ptr @B, i8 0, i64 4096, i32 1, i1 false)
call void @loop_with_condition()
br label %1

; <label>:1 ; preds = %8, %0
%indvar1 = phi i64 [ %indvar.next2, %8 ], [ 0, %0 ] ; <i64> [#uses=3]
%scevgep3 = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar1 ; <i32*> [#uses=1]
%scevgep3 = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar1 ; <ptr> [#uses=1]
%i.0 = trunc i64 %indvar1 to i32 ; <i32> [#uses=1]
%2 = icmp slt i32 %i.0, 1024 ; <i1> [#uses=1]
br i1 %2, label %3, label %9

; <label>:3 ; preds = %1
%4 = load i32, i32* %scevgep3 ; <i32> [#uses=1]
%4 = load i32, ptr %scevgep3 ; <i32> [#uses=1]
%5 = icmp ne i32 %4, 3 ; <i1> [#uses=1]
br i1 %5, label %6, label %7

Expand All @@ -116,7 +116,7 @@ define i32 @main() nounwind {

; <label>:10 ; preds = %26, %9
%indvar = phi i64 [ %indvar.next, %26 ], [ 0, %9 ] ; <i64> [#uses=3]
%scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar ; <i32*> [#uses=2]
%scevgep = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar ; <ptr> [#uses=2]
%i.1 = trunc i64 %indvar to i32 ; <i32> [#uses=3]
%11 = icmp slt i32 %i.1, 1024 ; <i1> [#uses=1]
br i1 %11, label %12, label %27
Expand All @@ -126,7 +126,7 @@ define i32 @main() nounwind {
br i1 %13, label %14, label %18

; <label>:14 ; preds = %12
%15 = load i32, i32* %scevgep ; <i32> [#uses=1]
%15 = load i32, ptr %scevgep ; <i32> [#uses=1]
%16 = icmp ne i32 %15, 1 ; <i1> [#uses=1]
br i1 %16, label %17, label %18

Expand All @@ -138,7 +138,7 @@ define i32 @main() nounwind {
br i1 %19, label %20, label %24

; <label>:20 ; preds = %18
%21 = load i32, i32* %scevgep ; <i32> [#uses=1]
%21 = load i32, ptr %scevgep ; <i32> [#uses=1]
%22 = icmp ne i32 %21, 2 ; <i1> [#uses=1]
br i1 %22, label %23, label %24

Expand All @@ -163,7 +163,7 @@ define i32 @main() nounwind {
ret i32 %.0
}

declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i32, i1) nounwind

; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 1) {
; CHECK: if (c0 >= 513) {
Expand Down
26 changes: 13 additions & 13 deletions polly/test/CodeGen/loop_with_condition_2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ entry:

for.cond: ; preds = %for.inc, %entry
%indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar
%arrayidx10 = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar
%arrayidx = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar
%arrayidx10 = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar
%tmp2 = add i64 %tmp1, %indvar
%sub = trunc i64 %tmp2 to i32
%exitcond = icmp ne i64 %indvar, 1024
Expand All @@ -38,15 +38,15 @@ for.body: ; preds = %for.cond
br i1 %cmp3, label %if.then, label %if.else

if.then: ; preds = %for.body
store i32 1, i32* %arrayidx
store i32 1, ptr %arrayidx
br label %if.end

if.else: ; preds = %for.body
store i32 2, i32* %arrayidx
store i32 2, ptr %arrayidx
br label %if.end

if.end: ; preds = %if.else, %if.then
store i32 3, i32* %arrayidx10
store i32 3, ptr %arrayidx10
br label %for.inc

for.inc: ; preds = %if.end
Expand All @@ -60,20 +60,20 @@ for.end: ; preds = %for.cond

define i32 @main() nounwind {
entry:
call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @A to i8*), i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @B to i8*), i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0.i64(ptr @A, i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0.i64(ptr @B, i8 0, i64 4096, i32 1, i1 false)
call void @loop_with_condition(i32 5)
br label %for.cond

for.cond: ; preds = %for.inc, %entry
%indvar1 = phi i64 [ %indvar.next2, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar1
%arrayidx = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar1
%i.0 = trunc i64 %indvar1 to i32
%cmp = icmp slt i32 %i.0, 1024
br i1 %cmp, label %for.body, label %for.end

for.body: ; preds = %for.cond
%tmp3 = load i32, i32* %arrayidx
%tmp3 = load i32, ptr %arrayidx
%cmp4 = icmp ne i32 %tmp3, 3
br i1 %cmp4, label %if.then, label %if.end

Expand All @@ -92,7 +92,7 @@ for.end: ; preds = %for.cond

for.cond6: ; preds = %for.inc12, %for.end
%indvar = phi i64 [ %indvar.next, %for.inc12 ], [ 0, %for.end ]
%arrayidx15 = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar
%arrayidx15 = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar
%i.1 = trunc i64 %indvar to i32
%cmp8 = icmp slt i32 %i.1, 1024
br i1 %cmp8, label %for.body9, label %for.end35
Expand All @@ -101,7 +101,7 @@ for.body9: ; preds = %for.cond6
br i1 true, label %land.lhs.true, label %if.else

land.lhs.true: ; preds = %for.body9
%tmp16 = load i32, i32* %arrayidx15
%tmp16 = load i32, ptr %arrayidx15
%cmp17 = icmp ne i32 %tmp16, 1
br i1 %cmp17, label %if.then18, label %if.else

Expand All @@ -112,7 +112,7 @@ if.else: ; preds = %land.lhs.true, %for
br i1 false, label %land.lhs.true23, label %if.end30

land.lhs.true23: ; preds = %if.else
%tmp27 = load i32, i32* %arrayidx15
%tmp27 = load i32, ptr %arrayidx15
%cmp28 = icmp ne i32 %tmp27, 2
br i1 %cmp28, label %if.then29, label %if.end30

Expand All @@ -137,4 +137,4 @@ return: ; preds = %for.end35, %if.then
ret i32 %retval.0
}

declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i32, i1) nounwind
30 changes: 15 additions & 15 deletions polly/test/CodeGen/loop_with_condition_ineq.ll
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

target 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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"

@A = common global [1024 x i32] zeroinitializer, align 16 ; <[1024 x i32]*> [#uses=4]
@B = common global [1024 x i32] zeroinitializer, align 16 ; <[1024 x i32]*> [#uses=4]
@A = common global [1024 x i32] zeroinitializer, align 16 ; <ptr> [#uses=4]
@B = common global [1024 x i32] zeroinitializer, align 16 ; <ptr> [#uses=4]

define void @loop_with_condition_ineq() nounwind {
bb0:
Expand All @@ -51,8 +51,8 @@ bb0:

bb1:
%indvar = phi i64 [ %indvar.next, %bb7 ], [ 0, %bb0 ] ; <i64> [#uses=5]
%scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar ; <i32*> [#uses=2]
%scevgep1 = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar ; <i32*> [#uses=1]
%scevgep = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar ; <ptr> [#uses=2]
%scevgep1 = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar ; <ptr> [#uses=1]
%i.0 = trunc i64 %indvar to i32 ; <i32> [#uses=1]
%exitcond = icmp ne i64 %indvar, 1024 ; <i1> [#uses=1]
br i1 %exitcond, label %bb2, label %bb8
Expand All @@ -62,15 +62,15 @@ bb2:
br i1 %var3, label %bb4, label %bb5

bb4:
store i32 1, i32* %scevgep
store i32 1, ptr %scevgep
br label %bb6

bb5:
store i32 2, i32* %scevgep
store i32 2, ptr %scevgep
br label %bb6

bb6:
store i32 3, i32* %scevgep1
store i32 3, ptr %scevgep1
br label %bb7

bb7:
Expand All @@ -84,20 +84,20 @@ bb8:

define i32 @main() nounwind {
; <label>:0
call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @A to i8*), i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0i8.i64(i8* bitcast ([1024 x i32]* @B to i8*), i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0.i64(ptr @A, i8 0, i64 4096, i32 1, i1 false)
call void @llvm.memset.p0.i64(ptr @B, i8 0, i64 4096, i32 1, i1 false)
call void @loop_with_condition_ineq()
br label %1

; <label>:1 ; preds = %8, %0
%indvar1 = phi i64 [ %indvar.next2, %8 ], [ 0, %0 ] ; <i64> [#uses=3]
%scevgep3 = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar1 ; <i32*> [#uses=1]
%scevgep3 = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar1 ; <ptr> [#uses=1]
%i.0 = trunc i64 %indvar1 to i32 ; <i32> [#uses=1]
%2 = icmp slt i32 %i.0, 1024 ; <i1> [#uses=1]
br i1 %2, label %3, label %9

; <label>:3 ; preds = %1
%4 = load i32, i32* %scevgep3 ; <i32> [#uses=1]
%4 = load i32, ptr %scevgep3 ; <i32> [#uses=1]
%5 = icmp ne i32 %4, 3 ; <i1> [#uses=1]
br i1 %5, label %6, label %7

Expand All @@ -116,7 +116,7 @@ define i32 @main() nounwind {

; <label>:10 ; preds = %26, %9
%indvar = phi i64 [ %indvar.next, %26 ], [ 0, %9 ] ; <i64> [#uses=3]
%scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar ; <i32*> [#uses=2]
%scevgep = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar ; <ptr> [#uses=2]
%i.1 = trunc i64 %indvar to i32 ; <i32> [#uses=3]
%11 = icmp slt i32 %i.1, 1024 ; <i1> [#uses=1]
br i1 %11, label %12, label %27
Expand All @@ -126,7 +126,7 @@ define i32 @main() nounwind {
br i1 %13, label %14, label %18

; <label>:14 ; preds = %12
%15 = load i32, i32* %scevgep ; <i32> [#uses=1]
%15 = load i32, ptr %scevgep ; <i32> [#uses=1]
%16 = icmp ne i32 %15, 1 ; <i1> [#uses=1]
br i1 %16, label %17, label %18

Expand All @@ -138,7 +138,7 @@ define i32 @main() nounwind {
br i1 %19, label %20, label %24

; <label>:20 ; preds = %18
%21 = load i32, i32* %scevgep ; <i32> [#uses=1]
%21 = load i32, ptr %scevgep ; <i32> [#uses=1]
%22 = icmp ne i32 %21, 2 ; <i1> [#uses=1]
br i1 %22, label %23, label %24

Expand All @@ -163,7 +163,7 @@ define i32 @main() nounwind {
ret i32 %.0
}

declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i32, i1) nounwind

; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 1) {
; CHECK: if (c0 == 512) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @jd(i32 %b, i32* %A) {
define void @jd(i32 %b, ptr %A) {
entry:
br label %while.begin

Expand Down Expand Up @@ -47,9 +47,9 @@ for.cond: ; preds = %for.inc, %if
br i1 %exitcond, label %for.body, label %while.begin

for.body: ; preds = %for.cond
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%tmp = trunc i64 %indvars.iv to i32
store i32 %tmp, i32* %arrayidx, align 4
store i32 %tmp, ptr %arrayidx, align 4
br label %for.inc

for.inc: ; preds = %for.body
Expand Down
6 changes: 3 additions & 3 deletions polly/test/CodeGen/memcpy_annotations.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
; }
;

declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1)
declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i32, i1)

define void @func(i32 %n, i8* noalias nonnull %A, i8* noalias nonnull %B) {
define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {
entry:
br label %for

Expand All @@ -21,7 +21,7 @@ for:
br i1 %j.cmp, label %body, label %exit

body:
call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull %A, i8* %B, i64 8, i32 4, i1 false)
call void @llvm.memcpy.p0.p0.i64(ptr nonnull %A, ptr %B, i64 8, i32 4, i1 false)
br label %inc

inc:
Expand Down
13 changes: 6 additions & 7 deletions polly/test/CodeGen/multidim-non-matching-typesize-2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
; CHECK: polly
target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"

define void @hoge(i16* %arg, i32 %arg1, i16* %arg2) {
define void @hoge(ptr %arg, i32 %arg1, ptr %arg2) {
bb:
%tmp = alloca i32
%tmp3 = load i32, i32* undef
%tmp3 = load i32, ptr undef
br label %bb7

bb7:
%tmp8 = phi i32 [ %tmp3, %bb ], [ %tmp13, %bb7 ]
%tmp9 = getelementptr inbounds i16, i16* %arg2, i32 0
%tmp10 = load i16, i16* %tmp9, align 2
%tmp10 = load i16, ptr %arg2, align 2
%tmp11 = mul nsw i32 %tmp8, %arg1
%tmp12 = getelementptr inbounds i16, i16* %arg, i32 %tmp11
store i16 undef, i16* %tmp12, align 2
%tmp12 = getelementptr inbounds i16, ptr %arg, i32 %tmp11
store i16 undef, ptr %tmp12, align 2
%tmp13 = add nsw i32 %tmp8, 1
store i32 undef, i32* %tmp
store i32 undef, ptr %tmp
br i1 false, label %bb7, label %bb5

bb5:
Expand Down
8 changes: 4 additions & 4 deletions polly/test/CodeGen/multidim-non-matching-typesize.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"

; CHECK: polly

define void @hoge(i16* %arg, i32 %arg1) {
define void @hoge(ptr %arg, i32 %arg1) {
bb:
%tmp = alloca i16
br label %bb2

bb2:
%tmp3 = phi i32 [ %tmp7, %bb2 ], [ 0, %bb ]
%tmp4 = mul nsw i32 %tmp3, %arg1
%tmp5 = getelementptr inbounds i16, i16* %arg, i32 %tmp4
%tmp6 = load i16, i16* %tmp5, align 2
store i16 %tmp6, i16* %tmp
%tmp5 = getelementptr inbounds i16, ptr %arg, i32 %tmp4
%tmp6 = load i16, ptr %tmp5, align 2
store i16 %tmp6, ptr %tmp
%tmp7 = add nsw i32 %tmp3, 1
br i1 false, label %bb2, label %bb8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; CHECK: %polly.rtc.result = and i1 %0, true
; CHECK: br i1 %polly.rtc.result, label %polly.start, label %for.i

define void @foo(i64 %n, i64 %m, double* %A) {
define void @foo(i64 %n, i64 %m, ptr %A) {
entry:
br label %for.i

Expand All @@ -27,8 +27,8 @@ for.i:
for.j:
%j = phi i64 [ 0, %for.i ], [ %j.inc, %for.j ]
%vlaarrayidx.sum = add i64 %j, %tmp
%arrayidx = getelementptr inbounds double, double* %A, i64 %vlaarrayidx.sum
store double 1.0, double* %arrayidx
%arrayidx = getelementptr inbounds double, ptr %A, i64 %vlaarrayidx.sum
store double 1.0, ptr %arrayidx
%j.inc = add nsw i64 %j, 1
%j.exitcond = icmp eq i64 %j.inc, 150
br i1 %j.exitcond, label %for.i.inc, label %for.j
Expand Down
14 changes: 6 additions & 8 deletions polly/test/CodeGen/multidim_alias_check.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; CHECK: %polly.access.sext.A = sext i32 %n to i64
; CHECK: %polly.access.mul.A = mul i64 %polly.access.sext.A, %0
; CHECK: %polly.access.add.A = add i64 %polly.access.mul.A, 1
; CHECK: %polly.access.A = getelementptr double, double* %A, i64 %polly.access.add.A
; CHECK: %polly.access.y = getelementptr double, double* %y, i64 0
; CHECK: icmp ule double* %polly.access.A, %polly.access.y
; CHECK: %polly.access.A = getelementptr double, ptr %A, i64 %polly.access.add.A
; CHECK: icmp ule ptr %polly.access.A, %y


define void @init_array(i32 %n, double* %A, double* %y) {
define void @init_array(i32 %n, ptr %A, ptr %y) {
entry:
%add3 = add nsw i32 %n, 1
%tmp = zext i32 %add3 to i64
br label %for.body

for.body:
%i.04 = phi i32 [ %inc39, %for.cond.loopexit ], [ 0, %entry ]
%arrayidx16 = getelementptr inbounds double, double* %y, i64 0
store double 1.0, double* %arrayidx16
store double 1.0, ptr %y
%cmp251 = icmp slt i32 %n, 0
%inc39 = add nsw i32 %i.04, 1
br i1 %cmp251, label %for.cond.loopexit, label %for.body27
Expand All @@ -27,8 +25,8 @@ for.body27:
%idxprom35 = sext i32 %i.04 to i64
%tmp1 = mul nsw i64 %idxprom35, %tmp
%arrayidx36.sum = add i64 0, %tmp1
%arrayidx37 = getelementptr inbounds double, double* %A, i64 %arrayidx36.sum
store double 1.0, double* %arrayidx37
%arrayidx37 = getelementptr inbounds double, ptr %A, i64 %arrayidx36.sum
store double 1.0, ptr %arrayidx37
br label %for.cond.loopexit

for.cond.loopexit:
Expand Down
10 changes: 5 additions & 5 deletions polly/test/CodeGen/multiple-codegens.ll
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
define i32 @main() {
entry:
%retval = alloca i32, align 4
store i32 0, i32* %retval, align 4
%.pre = load i32, i32* @a, align 4
store i32 0, ptr %retval, align 4
%.pre = load i32, ptr @a, align 4
br label %while.cond

while.cond: ; preds = %while.end, %entry
%0 = phi i32 [ %inc, %while.end ], [ %.pre, %entry ]
%inc = add nsw i32 %0, 1
store i32 %inc, i32* @a, align 4
store i32 %inc, ptr @a, align 4
%tobool = icmp ne i32 %0, 0
br i1 %tobool, label %while.body, label %while.end4

while.body: ; preds = %while.cond
%1 = load i32, i32* @b, align 4
%1 = load i32, ptr @b, align 4
%tobool2 = icmp ne i32 %1, 0
br i1 %tobool2, label %while.body3, label %while.end

while.body3: ; preds = %while.body
store i32 0, i32* @c, align 4
store i32 0, ptr @c, align 4
br label %while.end

while.end: ; preds = %while.body3, %while.body
Expand Down
6 changes: 3 additions & 3 deletions polly/test/CodeGen/multiple-scops-in-a-row.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @hoge(i8* %arg) {
define void @hoge(ptr %arg) {
bb:
br label %bb1

bb1: ; preds = %bb
%tmp = getelementptr inbounds i8, i8* %arg, i64 5
%tmp2 = getelementptr inbounds i8, i8* %arg, i64 6
%tmp = getelementptr inbounds i8, ptr %arg, i64 5
%tmp2 = getelementptr inbounds i8, ptr %arg, i64 6
br i1 false, label %bb3, label %bb4

bb3: ; preds = %bb1
Expand Down
Loading