From fc78ebad051ac3e7564efc1a38a5e1faa8f30bf1 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 17 Mar 2023 14:45:41 +0100 Subject: [Polly] Convert some tests to opaque pointers (NFC) --- .../aliasing_different_base_and_access_type.ll | 18 +++---- .../CodeGen/aliasing_different_pointer_types.ll | 29 ++++++----- polly/test/CodeGen/aliasing_parametric_simple_1.ll | 28 +++++------ polly/test/CodeGen/aliasing_parametric_simple_2.ll | 32 ++++++------ polly/test/CodeGen/annotated_alias_scopes.ll | 28 +++++------ polly/test/CodeGen/invariant_load.ll | 19 +++---- polly/test/CodeGen/invariant_load_address_space.ll | 19 +++---- polly/test/CodeGen/invariant_load_base_pointer.ll | 17 ++++--- .../invariant_load_base_pointer_conditional.ll | 19 +++---- .../invariant_load_base_pointer_conditional_2.ll | 34 ++++++------- .../invariant_load_canonicalize_array_baseptrs.ll | 20 ++++---- polly/test/CodeGen/invariant_load_condition.ll | 16 +++--- polly/test/CodeGen/invariant_load_escaping.ll | 20 ++++---- .../test/CodeGen/invariant_load_ptr_ptr_noalias.ll | 29 +++++------ polly/test/CodeGen/invariant_load_scalar_dep.ll | 19 +++---- polly/test/CodeGen/load_subset_with_context.ll | 17 +++---- polly/test/CodeGen/loop_with_condition_nested.ll | 36 +++++++------- .../test/CodeGen/multiple-types-invariant-load.ll | 23 ++++----- polly/test/CodeGen/no-overflow-tracking.ll | 24 ++++----- .../non-affine-subregion-dominance-reuse.ll | 30 +++++------ polly/test/CodeGen/non-affine-switch.ll | 25 +++++----- .../CodeGen/non-affine-synthesized-in-branch.ll | 14 +++--- polly/test/CodeGen/non-affine-update.ll | 31 ++++++------ polly/test/CodeGen/non_affine_float_compare.ll | 48 ++++++++++-------- polly/test/CodeGen/partial_write_array.ll | 10 ++-- ...artial_write_full_write_that_appears_partial.ll | 10 ++-- .../partial_write_impossible_restriction.ll | 24 ++++----- polly/test/CodeGen/partial_write_in_region.ll | 29 +++++------ polly/test/CodeGen/phi_conditional_simple_1.ll | 20 ++++---- polly/test/CodeGen/phi_loop_carried_float.ll | 24 ++++----- .../test/CodeGen/phi_loop_carried_float_escape.ll | 28 +++++------ polly/test/CodeGen/region-with-instructions.ll | 19 +++---- polly/test/CodeGen/scev-backedgetaken.ll | 14 +++--- polly/test/CodeGen/scev_expansion_in_nonaffine.ll | 58 +++++++++++----------- .../test/CodeGen/scev_looking_through_bitcasts.ll | 16 +++--- polly/test/CodeGen/single_loop_param_less_equal.ll | 15 +++--- polly/test/CodeGen/single_loop_param_less_than.ll | 13 ++--- polly/test/CodeGen/stmt_split_no_dependence.ll | 16 +++--- polly/test/CodeGen/switch-in-non-affine-region.ll | 24 ++++----- 39 files changed, 461 insertions(+), 454 deletions(-) (limited to 'polly') diff --git a/polly/test/CodeGen/aliasing_different_base_and_access_type.ll b/polly/test/CodeGen/aliasing_different_base_and_access_type.ll index ddcda888e15f..a087414b8403 100644 --- a/polly/test/CodeGen/aliasing_different_base_and_access_type.ll +++ b/polly/test/CodeGen/aliasing_different_base_and_access_type.ll @@ -1,13 +1,12 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -S -polly-codegen < %s | FileCheck %s +; RUN: opt %loadPolly -S -polly-codegen < %s | FileCheck %s ; ; We have to cast %B to "short *" before we create RTCs. ; -; CHECK: %polly.access.cast.B = bitcast i32* %B to i16* -; CHECK-NEXT: %polly.access.B = getelementptr i16, i16* %polly.access.cast.B, i64 1024 +; CHECK: %polly.access.B = getelementptr i16, ptr %B, i64 1024 ; ; We should never access %B as an i32 pointer: ; -; CHECK-NOT: getelementptr i32, i32* %B +; CHECK-NOT: getelementptr i32, ptr %B ; ; void jd(int *A, int *B) { ; for (int i = 0; i < 1024; i++) @@ -16,7 +15,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @jd(i32* %A, i32* %B) { +define void @jd(ptr %A, ptr %B) { entry: br label %for.cond @@ -26,12 +25,11 @@ for.cond: ; preds = %for.inc, %entry br i1 %exitcond, label %for.body, label %for.end for.body: ; preds = %for.cond - %tmp = bitcast i32* %B to i16* - %arrayidx = getelementptr inbounds i16, i16* %tmp, i64 %indvars.iv - %tmp1 = load i16, i16* %arrayidx, align 2 + %arrayidx = getelementptr inbounds i16, ptr %B, i64 %indvars.iv + %tmp1 = load i16, ptr %arrayidx, align 2 %conv = sext i16 %tmp1 to i32 - %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %conv, i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %conv, ptr %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body diff --git a/polly/test/CodeGen/aliasing_different_pointer_types.ll b/polly/test/CodeGen/aliasing_different_pointer_types.ll index 94582676a3f9..91f5eab6b2a6 100644 --- a/polly/test/CodeGen/aliasing_different_pointer_types.ll +++ b/polly/test/CodeGen/aliasing_different_pointer_types.ll @@ -1,18 +1,18 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s ; ; Check that we cast the different pointer types correctly before we compare ; them in the RTC's. We use i8* as max pointer type. ; ; CHECK: polly.split_new_and_old: -; CHECK: %polly.access.B = getelementptr float*, float** %B, i64 1024 -; CHECK: %polly.access.A = getelementptr double*, double** %A, i64 0 -; CHECK: %[[paBb:[._a-zA-Z0-9]]] = ptrtoint float** %polly.access.B to i64 -; CHECK: %[[paAb:[._a-zA-Z0-9]]] = ptrtoint double** %polly.access.A to i64 +; CHECK: %polly.access.B = getelementptr ptr, ptr %B, i64 1024 +; CHECK: %polly.access.A = getelementptr ptr, ptr %A, i64 0 +; CHECK: %[[paBb:[._a-zA-Z0-9]]] = ptrtoint ptr %polly.access.B to i64 +; CHECK: %[[paAb:[._a-zA-Z0-9]]] = ptrtoint ptr %polly.access.A to i64 ; CHECK: %[[ALeB:[._a-zA-Z0-9]]] = icmp ule i64 %[[paBb]], %[[paAb]] -; CHECK: %polly.access.A1 = getelementptr double*, double** %A, i64 1024 -; CHECK: %polly.access.B2 = getelementptr float*, float** %B, i64 0 -; CHECK: %[[paA1b:[._a-zA-Z0-9]]] = ptrtoint double** %polly.access.A1 to i64 -; CHECK: %[[paB2b:[._a-zA-Z0-9]]] = ptrtoint float** %polly.access.B2 to i64 +; CHECK: %polly.access.A1 = getelementptr ptr, ptr %A, i64 1024 +; CHECK: %polly.access.B2 = getelementptr ptr, ptr %B, i64 0 +; CHECK: %[[paA1b:[._a-zA-Z0-9]]] = ptrtoint ptr %polly.access.A1 to i64 +; CHECK: %[[paB2b:[._a-zA-Z0-9]]] = ptrtoint ptr %polly.access.B2 to i64 ; CHECK: %[[A1LeB2:[._a-zA-Z0-9]]] = icmp ule i64 %[[paA1b]], %[[paB2b]] ; CHECK: %[[le1OrLe2:[._a-zA-Z0-9]]] = or i1 %[[ALeB]], %[[A1LeB2]] ; CHECK: %[[orAndTrue:[._a-zA-Z0-9]]] = and i1 true, %[[le1OrLe2]] @@ -24,7 +24,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @jd(double** %A, float** %B) { +define void @jd(ptr %A, ptr %B) { entry: br label %for.cond @@ -34,11 +34,10 @@ for.cond: ; preds = %for.inc, %entry br i1 %exitcond, label %for.body, label %for.end for.body: ; preds = %for.cond - %arrayidx = getelementptr inbounds float*, float** %B, i64 %indvars.iv - %tmp = load float*, float** %arrayidx, align 8 - %tmp1 = bitcast float* %tmp to double* - %arrayidx2 = getelementptr inbounds double*, double** %A, i64 %indvars.iv - store double* %tmp1, double** %arrayidx2, align 8 + %arrayidx = getelementptr inbounds ptr, ptr %B, i64 %indvars.iv + %tmp = load ptr, ptr %arrayidx, align 8 + %arrayidx2 = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv + store ptr %tmp, ptr %arrayidx2, align 8 br label %for.inc for.inc: ; preds = %for.body diff --git a/polly/test/CodeGen/aliasing_parametric_simple_1.ll b/polly/test/CodeGen/aliasing_parametric_simple_1.ll index aa72882e909e..5422da4426e9 100644 --- a/polly/test/CodeGen/aliasing_parametric_simple_1.ll +++ b/polly/test/CodeGen/aliasing_parametric_simple_1.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s ; ; void jd(int *A, int *B, int c) { ; for (int i = 0; i < 1024; i++) @@ -10,15 +10,15 @@ ; CHECK: %[[Cp1O:[._a-zA-Z0-9]*]] = extractvalue { i64, i1 } %[[Cp1]], 1 ; CHECK: %[[OS:[._a-zA-Z0-9]*]] = or i1 false, %[[Cp1O]] ; CHECK: %[[Cp1R:[._a-zA-Z0-9]*]] = extractvalue { i64, i1 } %[[Cp1]], 0 -; CHECK: %[[BMax:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %B, i64 %[[Cp1R]] -; CHECK: %[[AMin:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %A, i64 0 -; CHECK: %[[BMaxI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[BMax]] to i64 -; CHECK: %[[AMinI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[AMin]] to i64 +; CHECK: %[[BMax:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %B, i64 %[[Cp1R]] +; CHECK: %[[AMin:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %A, i64 0 +; CHECK: %[[BMaxI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[BMax]] to i64 +; CHECK: %[[AMinI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[AMin]] to i64 ; CHECK: %[[BltA:[._a-zA-Z0-9]*]] = icmp ule i64 %[[BMaxI]], %[[AMinI]] -; CHECK: %[[AMax:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %A, i64 1024 -; CHECK: %[[BMin:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %B, i32 %c -; CHECK: %[[AMaxI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[AMax]] to i64 -; CHECK: %[[BMinI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[BMin]] to i64 +; CHECK: %[[AMax:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %A, i64 1024 +; CHECK: %[[BMin:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %B, i32 %c +; CHECK: %[[AMaxI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[AMax]] to i64 +; CHECK: %[[BMinI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[BMin]] to i64 ; CHECK: %[[AltB:[._a-zA-Z0-9]*]] = icmp ule i64 %[[AMaxI]], %[[BMinI]] ; CHECK: %[[NoAlias:[._a-zA-Z0-9]*]] = or i1 %[[BltA]], %[[AltB]] ; CHECK: %[[RTC:[._a-zA-Z0-9]*]] = and i1 true, %[[NoAlias]] @@ -28,7 +28,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @jd(i32* %A, i32* %B, i32 %c) { +define void @jd(ptr %A, ptr %B, i32 %c) { entry: br label %for.cond @@ -39,10 +39,10 @@ for.cond: ; preds = %for.inc, %entry for.body: ; preds = %for.cond %idxprom = sext i32 %c to i64 - %arrayidx = getelementptr inbounds i32, i32* %B, i64 %idxprom - %tmp = load i32, i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %tmp, i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, ptr %B, i64 %idxprom + %tmp = load i32, ptr %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %tmp, ptr %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body diff --git a/polly/test/CodeGen/aliasing_parametric_simple_2.ll b/polly/test/CodeGen/aliasing_parametric_simple_2.ll index 510d6def7b03..de945d403f92 100644 --- a/polly/test/CodeGen/aliasing_parametric_simple_2.ll +++ b/polly/test/CodeGen/aliasing_parametric_simple_2.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s ; ; void jd(int *A, int *B, int c) { ; for (int i = 0; i < 1024; i++) @@ -13,12 +13,12 @@ ; CHECK-NEXT: %[[M3R:[._a-zA-Z0-9]*]] = extractvalue { i64, i1 } %[[M3]], 0 ; CHECK-NEXT: %[[M1:[._a-zA-Z0-9]*]] = icmp sgt i64 6, %[[M3R]] ; CHECK-NEXT: %[[M4:[._a-zA-Z0-9]*]] = select i1 %[[M1]], i64 6, i64 %[[M3R]] -; CHECK-NEXT: %[[BMax:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %B, i64 %[[M4]] -; CHECK-NEXT: %[[AMin:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %A, i64 0 -; CHECK-NEXT: %[[BMaxI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[BMax]] to i64 -; CHECK-NEXT: %[[AMinI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[AMin]] to i64 +; CHECK-NEXT: %[[BMax:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %B, i64 %[[M4]] +; CHECK-NEXT: %[[AMin:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %A, i64 0 +; CHECK-NEXT: %[[BMaxI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[BMax]] to i64 +; CHECK-NEXT: %[[AMinI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[AMin]] to i64 ; CHECK-NEXT: %[[BltA:[._a-zA-Z0-9]*]] = icmp ule i64 %[[BMaxI]], %[[AMinI]] -; CHECK-NEXT: %[[AMax:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %A, i64 1024 +; CHECK-NEXT: %[[AMax:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %A, i64 1024 ; CHECK-NEXT: %[[m0:[._a-zA-Z0-9]*]] = sext i32 %c to i64 ; CHECK-NEXT: %[[m3:[._a-zA-Z0-9]*]] = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 %[[m0]], i64 10) ; CHECK-NEXT: %[[m3O:[._a-zA-Z0-9]*]] = extractvalue { i64, i1 } %[[m3]], 1 @@ -26,9 +26,9 @@ ; CHECK-NEXT: %[[m3R:[._a-zA-Z0-9]*]] = extractvalue { i64, i1 } %[[m3]], 0 ; CHECK-NEXT: %[[m1:[._a-zA-Z0-9]*]] = icmp slt i64 5, %[[m3R]] ; CHECK-NEXT: %[[m4:[._a-zA-Z0-9]*]] = select i1 %[[m1]], i64 5, i64 %[[m3R]] -; CHECK-NEXT: %[[BMin:[._a-zA-Z0-9]*]] = getelementptr i32, i32* %B, i64 %[[m4]] -; CHECK-NEXT: %[[AMaxI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[AMax]] to i64 -; CHECK-NEXT: %[[BMinI:[._a-zA-Z0-9]*]] = ptrtoint i32* %[[BMin]] to i64 +; CHECK-NEXT: %[[BMin:[._a-zA-Z0-9]*]] = getelementptr i32, ptr %B, i64 %[[m4]] +; CHECK-NEXT: %[[AMaxI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[AMax]] to i64 +; CHECK-NEXT: %[[BMinI:[._a-zA-Z0-9]*]] = ptrtoint ptr %[[BMin]] to i64 ; CHECK-NEXT: %[[AltB:[._a-zA-Z0-9]*]] = icmp ule i64 %[[AMaxI]], %[[BMinI]] ; CHECK-NEXT: %[[NoAlias:[._a-zA-Z0-9]*]] = or i1 %[[BltA]], %[[AltB]] ; CHECK-NEXT: %[[RTC:[._a-zA-Z0-9]*]] = and i1 %[[Ctx]], %[[NoAlias]] @@ -38,7 +38,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @jd(i32* %A, i32* %B, i32 %c) { +define void @jd(ptr %A, ptr %B, i32 %c) { entry: br label %for.cond @@ -50,13 +50,13 @@ for.cond: ; preds = %for.inc, %entry for.body: ; preds = %for.cond %sub = add nsw i32 %c, -10 %idxprom = sext i32 %sub to i64 - %arrayidx = getelementptr inbounds i32, i32* %B, i64 %idxprom - %tmp = load i32, i32* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 5 - %tmp1 = load i32, i32* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, ptr %B, i64 %idxprom + %tmp = load i32, ptr %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 5 + %tmp1 = load i32, ptr %arrayidx1, align 4 %add = add nsw i32 %tmp, %tmp1 - %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %add, i32* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %add, ptr %arrayidx3, align 4 br label %for.inc for.inc: ; preds = %for.body diff --git a/polly/test/CodeGen/annotated_alias_scopes.ll b/polly/test/CodeGen/annotated_alias_scopes.ll index ae68af4e3433..f8d14cd34b62 100644 --- a/polly/test/CodeGen/annotated_alias_scopes.ll +++ b/polly/test/CodeGen/annotated_alias_scopes.ll @@ -1,14 +1,14 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -S < %s | FileCheck %s --check-prefix=SCOPES +; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s --check-prefix=SCOPES ; ; Check that we create alias scopes that indicate the accesses to A, B and C cannot alias in any way. ; ; SCOPES-LABEL: polly.stmt.for.body: -; SCOPES: %[[BIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} i32* %B, i64 %polly.indvar -; SCOPES: load i32, i32* %[[BIdx]], align 4, !alias.scope !0, !noalias !3 -; SCOPES: %[[CIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} float* %C, i64 %polly.indvar -; SCOPES: load float, float* %[[CIdx]], align 4, !alias.scope !6, !noalias !7 -; SCOPES: %[[AIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} i32* %A, i64 %polly.indvar -; SCOPES: store i32 %{{[._a-zA-Z0-9]*}}, i32* %[[AIdx]], align 4, !alias.scope !8, !noalias !9 +; SCOPES: %[[BIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} ptr %B, i64 %{{.*}} +; SCOPES: load i32, ptr %[[BIdx]], align 4, !alias.scope !0, !noalias !3 +; SCOPES: %[[CIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} ptr %C, i64 %{{.*}} +; SCOPES: load float, ptr %[[CIdx]], align 4, !alias.scope !6, !noalias !7 +; SCOPES: %[[AIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} ptr %A, i64 %{{.*}} +; SCOPES: store i32 %{{[._a-zA-Z0-9]*}}, ptr %[[AIdx]], align 4, !alias.scope !8, !noalias !9 ; ; SCOPES: !0 = !{!1} ; SCOPES: !1 = distinct !{!1, !2, !"polly.alias.scope.MemRef_B"} @@ -28,7 +28,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @jd(i32* %A, i32* %B, float* %C) { +define void @jd(ptr %A, ptr %B, ptr %C) { entry: br label %for.cond @@ -38,15 +38,15 @@ for.cond: ; preds = %for.inc, %entry br i1 %exitcond, label %for.body, label %for.end for.body: ; preds = %for.cond - %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv - %tmp = load i32, i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv + %tmp = load i32, ptr %arrayidx, align 4 %conv = sitofp i32 %tmp to float - %arrayidx2 = getelementptr inbounds float, float* %C, i64 %indvars.iv - %tmp1 = load float, float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, ptr %C, i64 %indvars.iv + %tmp1 = load float, ptr %arrayidx2, align 4 %add = fadd fast float %conv, %tmp1 %conv3 = fptosi float %add to i32 - %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %conv3, i32* %arrayidx5, align 4 + %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %conv3, ptr %arrayidx5, align 4 br label %for.inc for.inc: ; preds = %for.body diff --git a/polly/test/CodeGen/invariant_load.ll b/polly/test/CodeGen/invariant_load.ll index 2414fc219846..be3f7a32f35b 100644 --- a/polly/test/CodeGen/invariant_load.ll +++ b/polly/test/CodeGen/invariant_load.ll @@ -1,12 +1,13 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s ; ; CHECK-LABEL: polly.preload.begin: -; CHECK-NEXT: %polly.access.B = getelementptr i32, i32* %B, i64 0 -; CHECK-NEXT: %polly.access.B.load = load i32, i32* %polly.access.B +; CHECK-NEXT: %polly.access.B = getelementptr i32, ptr %B, i64 0 +; CHECK-NEXT: %polly.access.B.load = load i32, ptr %polly.access.B ; ; CHECK-LABEL: polly.stmt.bb2: -; CHECK-NEXT: %scevgep = getelementptr i32, i32* %A, i64 %polly.indvar -; CHECK-NEXT: store i32 %polly.access.B.load, i32* %scevgep, align 4 +; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2 +; CHECK-NEXT: %scevgep = getelementptr i8, ptr %A, i64 %[[offset]] +; CHECK-NEXT: store i32 %polly.access.B.load, ptr %scevgep, align 4 ; ; void f(int *restrict A, int *restrict B) { ; for (int i = 0; i < 1024; i++) @@ -15,7 +16,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32* noalias %A, i32* noalias %B) { +define void @f(ptr noalias %A, ptr noalias %B) { bb: br label %bb1 @@ -25,9 +26,9 @@ bb1: ; preds = %bb4, %bb br i1 %exitcond, label %bb2, label %bb5 bb2: ; preds = %bb1 - %tmp = load i32, i32* %B, align 4 - %tmp3 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %tmp, i32* %tmp3, align 4 + %tmp = load i32, ptr %B, align 4 + %tmp3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %tmp, ptr %tmp3, align 4 br label %bb4 bb4: ; preds = %bb2 diff --git a/polly/test/CodeGen/invariant_load_address_space.ll b/polly/test/CodeGen/invariant_load_address_space.ll index 4aac1aaee003..7c611ad3dd87 100644 --- a/polly/test/CodeGen/invariant_load_address_space.ll +++ b/polly/test/CodeGen/invariant_load_address_space.ll @@ -1,13 +1,14 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s ; ; CHECK-LABEL: polly.preload.begin: -; CHECK-NEXT: %polly.access.B = getelementptr i32, i32 addrspace(1)* %B, i64 0 +; CHECK-NEXT: %polly.access.B = getelementptr i32, ptr addrspace(1) %B, i64 0 ; CHECK-NOT: addrspacecast -; CHECK-NEXT: %polly.access.B.load = load i32, i32 addrspace(1)* %polly.access.B +; CHECK-NEXT: %polly.access.B.load = load i32, ptr addrspace(1) %polly.access.B ; ; CHECK-LABEL: polly.stmt.bb2: -; CHECK-NEXT: %scevgep = getelementptr i32, i32* %A, i64 %polly.indvar -; CHECK-NEXT: store i32 %polly.access.B.load, i32* %scevgep, align 4 +; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2 +; CHECK-NEXT: %scevgep = getelementptr i8, ptr %A, i64 %[[offset]] +; CHECK-NEXT: store i32 %polly.access.B.load, ptr %scevgep, align 4 ; ; void f(int *restrict A, int *restrict B) { ; for (int i = 0; i < 1024; i++) @@ -16,7 +17,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32* noalias %A, i32 addrspace(1)* noalias %B) { +define void @f(ptr noalias %A, ptr addrspace(1) noalias %B) { bb: br label %bb1 @@ -26,9 +27,9 @@ bb1: ; preds = %bb4, %bb br i1 %exitcond, label %bb2, label %bb5 bb2: ; preds = %bb1 - %tmp = load i32, i32 addrspace(1)* %B, align 4 - %tmp3 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %tmp, i32* %tmp3, align 4 + %tmp = load i32, ptr addrspace(1) %B, align 4 + %tmp3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %tmp, ptr %tmp3, align 4 br label %bb4 bb4: ; preds = %bb2 diff --git a/polly/test/CodeGen/invariant_load_base_pointer.ll b/polly/test/CodeGen/invariant_load_base_pointer.ll index 951d4cd9e3b2..eb07f8317b79 100644 --- a/polly/test/CodeGen/invariant_load_base_pointer.ll +++ b/polly/test/CodeGen/invariant_load_base_pointer.ll @@ -1,11 +1,12 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -S < %s | FileCheck %s ; ; CHECK-LABEL: polly.preload.begin: -; CHECK-NEXT: %polly.access.BPLoc = getelementptr i32*, i32** %BPLoc, i64 0 -; CHECK-NEXT: %polly.access.BPLoc.load = load i32*, i32** %polly.access.BPLoc +; CHECK-NEXT: %polly.access.BPLoc = getelementptr ptr, ptr %BPLoc, i64 0 +; CHECK-NEXT: %polly.access.BPLoc.load = load ptr, ptr %polly.access.BPLoc ; ; CHECK-LABEL: polly.stmt.bb2: -; CHECK-NEXT: %scevgep = getelementptr i32, i32* %polly.access.BPLoc.load, i64 %polly.indvar +; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2 +; CHECK-NEXT: %scevgep = getelementptr i8, ptr %polly.access.BPLoc.load, i64 %[[offset]] ; ; void f(int **BPLoc) { ; for (int i = 0; i < 1024; i++) @@ -14,7 +15,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32** %BPLoc) { +define void @f(ptr %BPLoc) { bb: br label %bb1 @@ -24,9 +25,9 @@ bb1: ; preds = %bb4, %bb br i1 %exitcond, label %bb2, label %bb5 bb2: ; preds = %bb1 - %tmp = load i32*, i32** %BPLoc, align 8 - %tmp3 = getelementptr inbounds i32, i32* %tmp, i64 %indvars.iv - store i32 0, i32* %tmp3, align 4 + %tmp = load ptr, ptr %BPLoc, align 8 + %tmp3 = getelementptr inbounds i32, ptr %tmp, i64 %indvars.iv + store i32 0, ptr %tmp3, align 4 br label %bb4 bb4: ; preds = %bb2 diff --git a/polly/test/CodeGen/invariant_load_base_pointer_conditional.ll b/polly/test/CodeGen/invariant_load_base_pointer_conditional.ll index 472d79d26022..538077bb09e8 100644 --- a/polly/test/CodeGen/invariant_load_base_pointer_conditional.ll +++ b/polly/test/CodeGen/invariant_load_base_pointer_conditional.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -S < %s | FileCheck %s ; ; CHECK-LABEL: polly.preload.begin: ; CHECK-NEXT: %0 = sext i32 %N to i64 @@ -10,10 +10,11 @@ ; CHECK-NEXT: br i1 %polly.preload.cond.result, label %polly.preload.exec, label %polly.preload.merge ; ; CHECK-LABEL: polly.preload.merge: -; CHECK-NEXT: %polly.preload.tmp6.merge = phi i32* [ %polly.access.BPLoc.load, %polly.preload.exec ], [ null, %polly.preload.cond ] +; CHECK-NEXT: %polly.preload.tmp6.merge = phi ptr [ %polly.access.BPLoc.load, %polly.preload.exec ], [ null, %polly.preload.cond ] ; ; CHECK-LABEL: polly.stmt.bb5: -; CHECK-NEXT: %scevgep9 = getelementptr i32, i32* %polly.preload.tmp6.merge, i64 %polly.indvar6 +; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar6, 2 +; CHECK-NEXT: %{{.*}} = getelementptr i8, ptr %polly.preload.tmp6.merge, i64 %[[offset]] ; ; void f(int **BPLoc, int *A, int N) { ; for (int i = 0; i < N; i++) @@ -25,7 +26,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32** %BPLoc, i32* %A, i32 %N) { +define void @f(ptr %BPLoc, ptr %A, i32 %N) { bb: %tmp = sext i32 %N to i64 br label %bb1 @@ -40,14 +41,14 @@ bb3: ; preds = %bb1 br i1 %tmp4, label %bb5, label %bb8 bb5: ; preds = %bb3 - %tmp6 = load i32*, i32** %BPLoc, align 8 - %tmp7 = getelementptr inbounds i32, i32* %tmp6, i64 %indvars.iv - store i32 0, i32* %tmp7, align 4 + %tmp6 = load ptr, ptr %BPLoc, align 8 + %tmp7 = getelementptr inbounds i32, ptr %tmp6, i64 %indvars.iv + store i32 0, ptr %tmp7, align 4 br label %bb10 bb8: ; preds = %bb3 - %tmp9 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 0, i32* %tmp9, align 4 + %tmp9 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 0, ptr %tmp9, align 4 br label %bb10 bb10: ; preds = %bb8, %bb5 diff --git a/polly/test/CodeGen/invariant_load_base_pointer_conditional_2.ll b/polly/test/CodeGen/invariant_load_base_pointer_conditional_2.ll index e8e2c29f211e..7c2fb3ef97ed 100644 --- a/polly/test/CodeGen/invariant_load_base_pointer_conditional_2.ll +++ b/polly/test/CodeGen/invariant_load_base_pointer_conditional_2.ll @@ -1,6 +1,6 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-invariant-load-hoisting=true -polly-print-scops -disable-output < %s | FileCheck %s -; RUN: opt -opaque-pointers=0 %loadPolly -S -polly-codegen -polly-invariant-load-hoisting=true < %s | FileCheck %s --check-prefix=IR -; RUN: opt -opaque-pointers=0 %loadPolly -S -polly-codegen -polly-invariant-load-hoisting=true --polly-overflow-tracking=always < %s | FileCheck %s --check-prefix=IRA +; RUN: opt %loadPolly -polly-invariant-load-hoisting=true -polly-print-scops -disable-output < %s | FileCheck %s +; RUN: opt %loadPolly -S -polly-codegen -polly-invariant-load-hoisting=true < %s | FileCheck %s --check-prefix=IR +; RUN: opt %loadPolly -S -polly-codegen -polly-invariant-load-hoisting=true --polly-overflow-tracking=always < %s | FileCheck %s --check-prefix=IRA ; ; As (p + q) can overflow we have to check that we load from ; I[p + q] only if it does not. @@ -15,8 +15,8 @@ ; CHECK-NEXT: } ; ; IR: polly.preload.merge: -; IR-NEXT: %polly.preload.tmp1.merge = phi i32* [ %polly.access.I.load, %polly.preload.exec ], [ null, %polly.preload.cond ] -; IR-NEXT: store i32* %polly.preload.tmp1.merge, i32** %tmp1.preload.s2a +; IR-NEXT: %polly.preload.tmp1.merge = phi ptr [ %polly.access.I.load, %polly.preload.exec ], [ null, %polly.preload.cond ] +; IR-NEXT: store ptr %polly.preload.tmp1.merge, ptr %tmp1.preload.s2a ; IR-NEXT: %12 = sext i32 %N to i64 ; IR-NEXT: %13 = icmp sge i64 %12, 1 ; IR-NEXT: %14 = sext i32 %q to i64 @@ -43,12 +43,12 @@ ; IR-NEXT: br i1 %polly.preload.cond.result11 ; ; IR: polly.preload.exec14: -; IR-NEXT: %polly.access.polly.preload.tmp1.merge = getelementptr i32, i32* %polly.preload.tmp1.merge, i64 0 -; IR-NEXT: %polly.access.polly.preload.tmp1.merge.load = load i32, i32* %polly.access.polly.preload.tmp1.merge, align 4 +; IR-NEXT: %polly.access.polly.preload.tmp1.merge = getelementptr i32, ptr %polly.preload.tmp1.merge, i64 0 +; IR-NEXT: %polly.access.polly.preload.tmp1.merge.load = load i32, ptr %polly.access.polly.preload.tmp1.merge, align 4 ; ; IRA: polly.preload.merge: -; IRA-NEXT: %polly.preload.tmp1.merge = phi i32* [ %polly.access.I.load, %polly.preload.exec ], [ null, %polly.preload.cond ] -; IRA-NEXT: store i32* %polly.preload.tmp1.merge, i32** %tmp1.preload.s2a +; IRA-NEXT: %polly.preload.tmp1.merge = phi ptr [ %polly.access.I.load, %polly.preload.exec ], [ null, %polly.preload.cond ] +; IRA-NEXT: store ptr %polly.preload.tmp1.merge, ptr %tmp1.preload.s2a ; IRA-NEXT: %12 = sext i32 %N to i64 ; IRA-NEXT: %13 = icmp sge i64 %12, 1 ; IRA-NEXT: %14 = sext i32 %q to i64 @@ -73,8 +73,8 @@ ; IRA-NEXT: br i1 %polly.preload.cond.result10 ; ; IRA: polly.preload.exec13: -; IRA-NEXT: %polly.access.polly.preload.tmp1.merge = getelementptr i32, i32* %polly.preload.tmp1.merge, i64 0 -; IRA-NEXT: %polly.access.polly.preload.tmp1.merge.load = load i32, i32* %polly.access.polly.preload.tmp1.merge, align 4 +; IRA-NEXT: %polly.access.polly.preload.tmp1.merge = getelementptr i32, ptr %polly.preload.tmp1.merge, i64 0 +; IRA-NEXT: %polly.access.polly.preload.tmp1.merge.load = load i32, ptr %polly.access.polly.preload.tmp1.merge, align 4 ; ; void f(int **I, int *A, int N, int p, int q) { ; for (int i = 0; i < N; i++) @@ -83,7 +83,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32** %I, i32* %A, i32 %N, i32 %p, i32 %q) { +define void @f(ptr %I, ptr %A, i32 %N, i32 %p, i32 %q) { entry: %tmp = sext i32 %N to i64 br label %for.cond @@ -96,11 +96,11 @@ for.cond: ; preds = %for.inc, %entry for.body: ; preds = %for.cond %add = add i32 %p, %q %idxprom = sext i32 %add to i64 - %arrayidx = getelementptr inbounds i32*, i32** %I, i64 %idxprom - %tmp1 = load i32*, i32** %arrayidx, align 8 - %tmp2 = load i32, i32* %tmp1, align 4 - %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %tmp2, i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds ptr, ptr %I, i64 %idxprom + %tmp1 = load ptr, ptr %arrayidx, align 8 + %tmp2 = load i32, ptr %tmp1, align 4 + %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %tmp2, ptr %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body diff --git a/polly/test/CodeGen/invariant_load_canonicalize_array_baseptrs.ll b/polly/test/CodeGen/invariant_load_canonicalize_array_baseptrs.ll index 0609a71b4104..dc5a4c890381 100644 --- a/polly/test/CodeGen/invariant_load_canonicalize_array_baseptrs.ll +++ b/polly/test/CodeGen/invariant_load_canonicalize_array_baseptrs.ll @@ -1,13 +1,13 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -S < %s \ +; RUN: opt %loadPolly -polly-codegen -S < %s \ ; RUN: -polly-invariant-load-hoisting \ ; RUN: | FileCheck %s -; CHECK: %polly.access.A = getelementptr float*, float** %A, i64 0 -; CHECK: %polly.access.A.load = load float*, float** %polly.access.A -; CHECK: store float 4.200000e+01, float* %polly.access.A.load -; CHECK: store float 4.800000e+01, float* %polly.access.A.load +; CHECK: %polly.access.A = getelementptr ptr, ptr %A, i64 0 +; CHECK: %polly.access.A.load = load ptr, ptr %polly.access.A +; CHECK: store float 4.200000e+01, ptr %polly.access.A.load +; CHECK: store float 4.800000e+01, ptr %polly.access.A.load -define void @foo(float** %A) { +define void @foo(ptr %A) { start: br label %loop @@ -18,13 +18,13 @@ loop: br i1 %icmp, label %body1, label %exit body1: - %baseA = load float*, float** %A - store float 42.0, float* %baseA + %baseA = load ptr, ptr %A + store float 42.0, ptr %baseA br label %body2 body2: - %baseB = load float*, float** %A - store float 48.0, float* %baseB + %baseB = load ptr, ptr %A + store float 48.0, ptr %baseB br label %latch latch: diff --git a/polly/test/CodeGen/invariant_load_condition.ll b/polly/test/CodeGen/invariant_load_condition.ll index 641765d2cc22..edf0814d8983 100644 --- a/polly/test/CodeGen/invariant_load_condition.ll +++ b/polly/test/CodeGen/invariant_load_condition.ll @@ -1,9 +1,9 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-process-unprofitable -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-process-unprofitable -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s ; ; CHECK-LABEL: polly.preload.begin: -; CHECK-NEXT: %polly.access.C = getelementptr i32, i32* %C, i64 0 -; CHECK-NEXT: %polly.access.C.load = load i32, i32* %polly.access.C -; CHECK-NOT: %polly.access.C.load = load i32, i32* %polly.access.C +; CHECK-NEXT: %polly.access.C = getelementptr i32, ptr %C, i64 0 +; CHECK-NEXT: %polly.access.C.load = load i32, ptr %polly.access.C +; CHECK-NOT: %polly.access.C.load = load i32, ptr %polly.access.C ; ; CHECK-LABEL: polly.cond: ; CHECK-NEXT: %[[R0:[0-9]*]] = sext i32 %polly.access.C.load to i64 @@ -23,7 +23,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32* %A, i32* %C) { +define void @f(ptr %A, ptr %C) { bb: br label %bb1 @@ -33,13 +33,13 @@ bb1: ; preds = %bb7, %bb br i1 %exitcond, label %bb2, label %bb8 bb2: ; preds = %bb1 - %tmp = load i32, i32* %C, align 4 + %tmp = load i32, ptr %C, align 4 %tmp3 = icmp eq i32 %tmp, 0 br i1 %tmp3, label %bb6, label %bb4 bb4: ; preds = %bb2 - %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 = %bb2, %bb4 diff --git a/polly/test/CodeGen/invariant_load_escaping.ll b/polly/test/CodeGen/invariant_load_escaping.ll index 80c0c7ff6e5c..efccdf468a18 100644 --- a/polly/test/CodeGen/invariant_load_escaping.ll +++ b/polly/test/CodeGen/invariant_load_escaping.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s ; ; int f(int *A, int *B) { ; // Possible aliasing between A and B but if not then *B would be @@ -16,9 +16,9 @@ ; } ; ; CHECK: polly.preload.begin: -; CHECK: %polly.access.B = getelementptr i32, i32* %B, i64 0 -; CHECK: %polly.access.B.load = load i32, i32* %polly.access.B -; CHECK: store i32 %polly.access.B.load, i32* %tmp.preload.s2a +; CHECK: %polly.access.B = getelementptr i32, ptr %B, i64 0 +; CHECK: %polly.access.B.load = load i32, ptr %polly.access.B +; CHECK: store i32 %polly.access.B.load, ptr %tmp.preload.s2a ; ; CHECK: polly.merge_new_and_old: ; CHECK: %tmp.merge = phi i32 [ %tmp.final_reload, %polly.exiting ], [ %tmp, %do.cond ] @@ -28,21 +28,21 @@ ; CHECK: ret i32 %tmp.merge ; ; CHECK: polly.loop_exit: -; CHECK: %tmp.final_reload = load i32, i32* %tmp.preload.s2a +; CHECK: %tmp.final_reload = load i32, ptr %tmp.preload.s2a ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define i32 @f(i32* %A, i32* %B) { +define i32 @f(ptr %A, ptr %B) { entry: br label %do.body do.body: ; preds = %do.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %do.cond ], [ 0, %entry ] - %tmp = load i32, i32* %B, align 4 - %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - %tmp1 = load i32, i32* %arrayidx, align 4 + %tmp = load i32, ptr %B, align 4 + %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + %tmp1 = load i32, ptr %arrayidx, align 4 %add = add nsw i32 %tmp1, %tmp - store i32 %add, i32* %arrayidx, align 4 + store i32 %add, ptr %arrayidx, align 4 br label %do.cond do.cond: ; preds = %do.body diff --git a/polly/test/CodeGen/invariant_load_ptr_ptr_noalias.ll b/polly/test/CodeGen/invariant_load_ptr_ptr_noalias.ll index bf599acbc7de..b4d4c55f0d9b 100644 --- a/polly/test/CodeGen/invariant_load_ptr_ptr_noalias.ll +++ b/polly/test/CodeGen/invariant_load_ptr_ptr_noalias.ll @@ -1,14 +1,15 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-process-unprofitable -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-process-unprofitable -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -S < %s | FileCheck %s ; ; CHECK-LABEL: polly.preload.begin: -; CHECK: %polly.access.A = getelementptr i32**, i32*** %A, i64 42 -; CHECK: %polly.access.A.load = load i32**, i32*** %polly.access.A -; CHECK: %polly.access.polly.access.A.load = getelementptr i32*, i32** %polly.access.A.load, i64 32 -; CHECK: %polly.access.polly.access.A.load.load = load i32*, i32** %polly.access.polly.access.A.load +; CHECK: %polly.access.A = getelementptr ptr, ptr %A, i64 42 +; CHECK: %polly.access.A.load = load ptr, ptr %polly.access.A +; CHECK: %polly.access.polly.access.A.load = getelementptr ptr, ptr %polly.access.A.load, i64 32 +; CHECK: %polly.access.polly.access.A.load.load = load ptr, ptr %polly.access.polly.access.A.load ; ; CHECK: polly.stmt.bb2: -; CHECK: %scevgep = getelementptr i32, i32* %polly.access.polly.access.A.load.load, i64 %polly.indvar -; CHECK: store i32 0, i32* %scevgep, align 4 +; CHECK: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2 +; CHECK: %scevgep = getelementptr i8, ptr %polly.access.polly.access.A.load.load, i64 %[[offset]] +; CHECK: store i32 0, ptr %scevgep, align 4 ; ; void f(int ***A) { ; for (int i = 0; i < 1024; i++) @@ -17,7 +18,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32*** %A) { +define void @f(ptr %A) { bb: br label %bb1 @@ -27,12 +28,12 @@ bb1: ; preds = %bb7, %bb br i1 %exitcond, label %bb2, label %bb8 bb2: ; preds = %bb1 - %tmp = getelementptr inbounds i32**, i32*** %A, i64 42 - %tmp3 = load i32**, i32*** %tmp, align 8 - %tmp4 = getelementptr inbounds i32*, i32** %tmp3, i64 32 - %tmp5 = load i32*, i32** %tmp4, align 8 - %tmp6 = getelementptr inbounds i32, i32* %tmp5, i64 %indvars.iv - store i32 0, i32* %tmp6, align 4 + %tmp = getelementptr inbounds ptr, ptr %A, i64 42 + %tmp3 = load ptr, ptr %tmp, align 8 + %tmp4 = getelementptr inbounds ptr, ptr %tmp3, i64 32 + %tmp5 = load ptr, ptr %tmp4, align 8 + %tmp6 = getelementptr inbounds i32, ptr %tmp5, i64 %indvars.iv + store i32 0, ptr %tmp6, align 4 br label %bb7 bb7: ; preds = %bb2 diff --git a/polly/test/CodeGen/invariant_load_scalar_dep.ll b/polly/test/CodeGen/invariant_load_scalar_dep.ll index 6ab75cf546c1..05a40a4c47cc 100644 --- a/polly/test/CodeGen/invariant_load_scalar_dep.ll +++ b/polly/test/CodeGen/invariant_load_scalar_dep.ll @@ -1,12 +1,13 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -S < %s | FileCheck %s ; ; CHECK-LABEL: polly.preload.begin: -; CHECK: %polly.access.B = getelementptr i32, i32* %B, i64 0 -; CHECK: %polly.access.B.load = load i32, i32* %polly.access.B +; CHECK: %polly.access.B = getelementptr i32, ptr %B, i64 0 +; CHECK: %polly.access.B.load = load i32, ptr %polly.access.B ; ; CHECK-LABEL: polly.stmt.bb2.split: -; CHECK: %scevgep = getelementptr i32, i32* %A, i64 %polly.indvar -; CHECK: store i32 %polly.access.B.load, i32* %scevgep, align 4 +; CHECK-NEXT: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2 +; CHECK-NEXT: %scevgep = getelementptr i8, ptr %A, i64 %[[offset]] +; CHECK: store i32 %polly.access.B.load, ptr %scevgep, align 4 ; ; void f(int *restrict A, int *restrict B) { ; for (int i = 0; i < 1024; i++) @@ -17,7 +18,7 @@ ; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @f(i32* noalias %A, i32* noalias %B) { +define void @f(ptr noalias %A, ptr noalias %B) { bb: br label %bb1 @@ -27,12 +28,12 @@ bb1: ; preds = %bb4, %bb br i1 %exitcond, label %bb2, label %bb5 bb2: ; preds = %bb1 - %tmp = load i32, i32* %B, align 4 + %tmp = load i32, ptr %B, align 4 br label %bb2.split bb2.split: - %tmp3 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv - store i32 %tmp, i32* %tmp3, align 4 + %tmp3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv + store i32 %tmp, ptr %tmp3, align 4 br label %bb4 bb4: ; preds = %bb2 diff --git a/polly/test/CodeGen/load_subset_with_context.ll b/polly/test/CodeGen/load_subset_with_context.ll index af8ba488970c..ef0e051d5635 100644 --- a/polly/test/CodeGen/load_subset_with_context.ll +++ b/polly/test/CodeGen/load_subset_with_context.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s | FileCheck %s ; ; A load must provide a value for every statement instance. ; Statement instances not in the SCoP's context are irrelevant. @@ -21,7 +21,7 @@ for.body: ; preds = %for.cond33.preheade br label %for.cond7.preheader for.cond33.preheader: ; preds = %for.inc.3 - %tmp175 = load float, float* undef, align 4 + %tmp175 = load float, ptr undef, align 4 %indvars.iv.next1000 = add nuw nsw i64 %indvars.iv999, 1 %exitcond1002 = icmp eq i64 %indvars.iv.next1000, 17 br i1 %exitcond1002, label %for.cond176.preheader, label %for.body @@ -29,8 +29,8 @@ for.cond33.preheader: ; preds = %for.inc.3 for.cond7.preheader: ; preds = %for.inc.3, %for.body %indvars.iv958 = phi i64 [ 0, %for.body ], [ %indvars.iv.next959, %for.inc.3 ] %tmp20 = add nuw nsw i64 %indvars.iv958, %tmp5 - %arrayidx.2 = getelementptr inbounds [88 x float], [88 x float]* @ATH, i64 0, i64 0 - %tmp157 = load float, float* %arrayidx.2, align 4 + %arrayidx.2 = getelementptr inbounds [88 x float], ptr @ATH, i64 0, i64 0 + %tmp157 = load float, ptr %arrayidx.2, align 4 %tmp158 = add nuw nsw i64 %tmp20, 3 %cmp12.3 = icmp ult i64 %tmp158, 88 br i1 %cmp12.3, label %if.then.3, label %if.else.3 @@ -43,8 +43,8 @@ if.then.3: ; preds = %for.cond7.preheader for.inc.3: ; preds = %if.then.3, %if.else.3 %min.1.3 = phi float [ undef, %if.then.3 ], [ %tmp157, %if.else.3 ] - %arrayidx29 = getelementptr inbounds [56 x float], [56 x float]* %ath, i64 0, i64 %indvars.iv958 - store float %min.1.3, float* %arrayidx29, align 4 + %arrayidx29 = getelementptr inbounds [56 x float], ptr %ath, i64 0, i64 %indvars.iv958 + store float %min.1.3, ptr %arrayidx29, align 4 %indvars.iv.next959 = add nuw nsw i64 %indvars.iv958, 1 %exitcond961 = icmp eq i64 %indvars.iv.next959, 56 br i1 %exitcond961, label %for.cond33.preheader, label %for.cond7.preheader @@ -52,6 +52,5 @@ for.inc.3: ; preds = %if.then.3, %if.else ; CHECK: polly.stmt.if.else.3: -; CHECK-NEXT: %polly.access.cast.ath1 = bitcast [56 x float]* %ath to float* -; CHECK-NEXT: %polly.access.ath2 = getelementptr float, float* %polly.access.cast.ath1, i64 %polly.indvar -; CHECK-NEXT: %polly.access.ath2.reload = load float, float* %polly.access.ath2 +; CHECK-NEXT: %polly.access.ath1 = getelementptr float, ptr %ath, i64 %polly.indvar +; CHECK-NEXT: %polly.access.ath1.reload = load float, ptr %polly.access.ath1 diff --git a/polly/test/CodeGen/loop_with_condition_nested.ll b/polly/test/CodeGen/loop_with_condition_nested.ll index 72c5f8b4918d..24a49b47d9e6 100644 --- a/polly/test/CodeGen/loop_with_condition_nested.ll +++ b/polly/test/CodeGen/loop_with_condition_nested.ll @@ -1,5 +1,5 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -basic-aa -polly-print-ast -disable-output < %s | FileCheck %s -; RUN: opt -opaque-pointers=0 %loadPolly -basic-aa -polly-codegen < %s | opt -opaque-pointers=0 -passes='print' -disable-output 2>&1 | FileCheck %s -check-prefix=LOOPS +; RUN: opt %loadPolly -basic-aa -polly-print-ast -disable-output < %s | FileCheck %s +; RUN: opt %loadPolly -basic-aa -polly-codegen < %s | opt -passes='print' -disable-output 2>&1 | FileCheck %s -check-prefix=LOOPS ;#include @@ -49,8 +49,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 ; [#uses=4] +@B = common global [1024 x i32] zeroinitializer, align 16 ; [#uses=4] define void @loop_with_condition() nounwind { bb0: @@ -59,8 +59,8 @@ bb0: bb1: %indvar = phi i64 [ %indvar.next, %bb10 ], [ 0, %bb0 ] ; [#uses=5] - %scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvar ; [#uses=2] - %scevgep1 = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar ; [#uses=1] + %scevgep = getelementptr [1024 x i32], ptr @A, i64 0, i64 %indvar ; [#uses=2] + %scevgep1 = getelementptr [1024 x i32], ptr @B, i64 0, i64 %indvar ; [#uses=1] %i.0 = trunc i64 %indvar to i32 ; [#uses=2] %exitcond = icmp ne i64 %indvar, 1024 ; [#uses=1] br i1 %exitcond, label %bb2, label %bb11 @@ -74,18 +74,18 @@ bb4: br i1 %var5, label %bb6, label %bb7 bb6: - store i32 1, i32* %scevgep + store i32 1, ptr %scevgep br label %bb8 bb7: - store i32 2, i32* %scevgep + store i32 2, ptr %scevgep br label %bb8 bb8: br label %bb9 bb9: - store i32 3, i32* %scevgep1 + store i32 3, ptr %scevgep1 br label %bb10 bb10: @@ -99,20 +99,20 @@ bb11: define i32 @main() nounwind { ;