From 55cb5796526b0cb72e90053ea146560c08a9c251 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 17 Mar 2023 15:28:24 +0100 Subject: [Polly] Convert remaining tests to opaque pointers (NFC) --- .../LoopParallelMD/single_loop_param_parallel.ll | 22 ++-- .../CodeGen/MemAccess/codegen_address_space.ll | 21 ++-- .../CodeGen/MemAccess/codegen_constant_offset.ll | 14 +-- polly/test/CodeGen/MemAccess/codegen_simple.ll | 14 +-- .../test/CodeGen/MemAccess/codegen_simple_float.ll | 14 +-- polly/test/CodeGen/MemAccess/codegen_simple_md.ll | 16 +-- .../CodeGen/MemAccess/codegen_simple_md_float.ll | 16 +-- polly/test/CodeGen/MemAccess/create_arrays.ll | 25 ++-- polly/test/CodeGen/MemAccess/create_arrays_heap.ll | 56 ++++----- polly/test/CodeGen/MemAccess/different_types.ll | 28 ++--- polly/test/CodeGen/MemAccess/generate-all.ll | 27 ++--- polly/test/CodeGen/MemAccess/invariant_base_ptr.ll | 20 ++-- .../invariant_base_ptr___%loop---%exit.jscop | 2 +- polly/test/CodeGen/MemAccess/map_scalar_access.ll | 46 ++++---- polly/test/CodeGen/MemAccess/multiple_types.ll | 48 ++++---- .../combine_different_values.ll | 128 +++++++++++---------- ..._inst_inside_invariant_1___%for.i---%exit.jscop | 2 +- .../base_pointer_load_setNewAccessRelation.ll | 10 +- 18 files changed, 249 insertions(+), 260 deletions(-) (limited to 'polly') diff --git a/polly/test/CodeGen/LoopParallelMD/single_loop_param_parallel.ll b/polly/test/CodeGen/LoopParallelMD/single_loop_param_parallel.ll index 3351d2f9feb2..ec927acb1ec7 100644 --- a/polly/test/CodeGen/LoopParallelMD/single_loop_param_parallel.ll +++ b/polly/test/CodeGen/LoopParallelMD/single_loop_param_parallel.ll @@ -1,5 +1,5 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -S < %s | FileCheck %s -check-prefix=SEQUENTIAL -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-ast-detect-parallel -S < %s | FileCheck %s -check-prefix=PARALLEL +; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s -check-prefix=SEQUENTIAL +; RUN: opt %loadPolly -polly-codegen -polly-ast-detect-parallel -S < %s | FileCheck %s -check-prefix=PARALLEL 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" ; This is a trivially parallel loop. We just use it to ensure that we actually @@ -20,8 +20,8 @@ loop.header: br i1 %exitcond, label %loop.body, label %ret loop.body: - %scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %i - store i32 1, i32* %scevgep + %scevgep = getelementptr [1024 x i32], ptr @A, i64 0, i64 %i + store i32 1, ptr %scevgep br label %loop.backedge loop.backedge: @@ -39,7 +39,7 @@ ret: ; SEQUENTIAL-NOT: !llvm.loop ; PARALLEL: @test-one -; PARALLEL: store i32 1, i32* %scevgep1, {{[ ._!,a-zA-Z0-9]*}}, !llvm.access.group ![[GROUPID3:[0-9]+]] +; PARALLEL: store i32 1, ptr %scevgep1, {{[ ._!,a-zA-Z0-9]*}}, !llvm.access.group ![[GROUPID3:[0-9]+]] ; PARALLEL: br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit, !llvm.loop ![[LoopID4:[0-9]+]] @@ -62,11 +62,11 @@ loop.header: loop.body: %loadoffset1 = mul nsw i64 %i, 2 %loadoffset2 = add nsw i64 %loadoffset1, 1 - %scevgepload = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %loadoffset2 - %val = load i32, i32* %scevgepload + %scevgepload = getelementptr [1024 x i32], ptr @A, i64 0, i64 %loadoffset2 + %val = load i32, ptr %scevgepload %storeoffset = mul i64 %i, 2 - %scevgepstore = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %storeoffset - store i32 %val, i32* %scevgepstore + %scevgepstore = getelementptr [1024 x i32], ptr @A, i64 0, i64 %storeoffset + store i32 %val, ptr %scevgepstore br label %loop.backedge loop.backedge: @@ -84,8 +84,8 @@ ret: ; SEQUENTIAL-NOT: !llvm.loop ; PARALLEL: @test-two -; PARALLEL: %val_p_scalar_ = load i32, i32* %scevgep, {{[ ._!,a-zA-Z0-9]*}}, !llvm.access.group ![[GROUPID8:[0-9]*]] -; PARALLEL: store i32 %val_p_scalar_, i32* %scevgep1, {{[ ._!,a-zA-Z0-9]*}}, !llvm.access.group ![[GROUPID8]] +; PARALLEL: %val_p_scalar_ = load i32, ptr %scevgep, {{[ ._!,a-zA-Z0-9]*}}, !llvm.access.group ![[GROUPID8:[0-9]*]] +; PARALLEL: store i32 %val_p_scalar_, ptr %scevgep1, {{[ ._!,a-zA-Z0-9]*}}, !llvm.access.group ![[GROUPID8]] ; PARALLEL: br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit, !llvm.loop ![[LoopID9:[0-9]*]] diff --git a/polly/test/CodeGen/MemAccess/codegen_address_space.ll b/polly/test/CodeGen/MemAccess/codegen_address_space.ll index f7e12e72e27a..76bcc40f0639 100644 --- a/polly/test/CodeGen/MemAccess/codegen_address_space.ll +++ b/polly/test/CodeGen/MemAccess/codegen_address_space.ll @@ -1,4 +1,4 @@ -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s ;int A[100]; ; @@ -11,24 +11,24 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -define i32 @codegen_simple([100 x i32] addrspace(5)* %A) nounwind { +define i32 @codegen_simple(ptr addrspace(5) %A) nounwind { entry: - %arrayidx.write = getelementptr [100 x i32], [100 x i32] addrspace(5)* %A, i32 0, i32 13 + %arrayidx.write = getelementptr [100 x i32], ptr addrspace(5) %A, i32 0, i32 13 br label %for.cond for.cond: ; preds = %for.inc, %entry %tmp1 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %tmp = add i32 %tmp1, -1 - %arrayidx4 = getelementptr [100 x i32], [100 x i32] addrspace(5)* %A, i32 0, i32 %tmp - %arrayidx = getelementptr [100 x i32], [100 x i32] addrspace(5)* %A, i32 0, i32 %tmp1 + %arrayidx4 = getelementptr [100 x i32], ptr addrspace(5) %A, i32 0, i32 %tmp + %arrayidx = getelementptr [100 x i32], ptr addrspace(5) %A, i32 0, i32 %tmp1 %exitcond = icmp ne i32 %tmp1, 12 br i1 %exitcond, label %for.body, label %for.end for.body: ; preds = %for.cond - %tmp2 = load i32, i32 addrspace(5)* %arrayidx, align 4 - %tmp5 = load i32, i32 addrspace(5)* %arrayidx4, align 4 + %tmp2 = load i32, ptr addrspace(5) %arrayidx, align 4 + %tmp5 = load i32, ptr addrspace(5) %arrayidx4, align 4 %add = add nsw i32 %tmp2, %tmp5 - store i32 %add, i32 addrspace(5)* %arrayidx.write + store i32 %add, ptr addrspace(5) %arrayidx.write br label %for.inc for.inc: ; preds = %for.body @@ -39,6 +39,5 @@ for.end: ; preds = %for.cond ret i32 0 } -; CHECK: %polly.access.cast.A = bitcast [100 x i32] addrspace(5)* %A to i32 addrspace(5)* -; CHECK: %polly.access.A = getelementptr i32, i32 addrspace(5)* %polly.access.cast.A, i64 0 -; CHECK: %tmp2_p_scalar_ = load i32, i32 addrspace(5)* %polly.access.A, align 4, !alias.scope !0, !noalias !3 +; CHECK: %polly.access.A = getelementptr i32, ptr addrspace(5) %A, i64 0 +; CHECK: %tmp2_p_scalar_ = load i32, ptr addrspace(5) %polly.access.A, align 4, !alias.scope !0, !noalias !3 diff --git a/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll b/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll index 2a934504fa21..ff12fe77f469 100644 --- a/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll +++ b/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll @@ -1,4 +1,4 @@ -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s ;int A[100]; ; @@ -20,16 +20,16 @@ entry: for.cond: ; preds = %for.inc, %entry %tmp1 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %tmp = add i32 %tmp1, -1 - %arrayidx4 = getelementptr [100 x i32], [100 x i32]* @A, i32 0, i32 %tmp - %arrayidx = getelementptr [100 x i32], [100 x i32]* @A, i32 0, i32 %tmp1 + %arrayidx4 = getelementptr [100 x i32], ptr @A, i32 0, i32 %tmp + %arrayidx = getelementptr [100 x i32], ptr @A, i32 0, i32 %tmp1 %exitcond = icmp ne i32 %tmp1, 12 br i1 %exitcond, label %for.body, label %for.end for.body: ; preds = %for.cond - %tmp2 = load i32, i32* %arrayidx, align 4 - %tmp5 = load i32, i32* %arrayidx4, align 4 + %tmp2 = load i32, ptr %arrayidx, align 4 + %tmp5 = load i32, ptr %arrayidx4, align 4 %add = add nsw i32 %tmp2, %tmp5 - store i32 %add, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i32 13), align 4 + store i32 %add, ptr getelementptr inbounds ([100 x i32], ptr @A, i32 0, i32 13), align 4 br label %for.inc for.inc: ; preds = %for.body @@ -39,4 +39,4 @@ for.inc: ; preds = %for.body for.end: ; preds = %for.cond ret i32 0 } -; CHECK: load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 10) +; CHECK: load i32, ptr getelementptr (i32, ptr @A, i{{(32|64)}} 10) diff --git a/polly/test/CodeGen/MemAccess/codegen_simple.ll b/polly/test/CodeGen/MemAccess/codegen_simple.ll index 21d741fb8788..0e64a6b6fbb8 100644 --- a/polly/test/CodeGen/MemAccess/codegen_simple.ll +++ b/polly/test/CodeGen/MemAccess/codegen_simple.ll @@ -1,4 +1,4 @@ -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s ;int A[100]; ; @@ -20,16 +20,16 @@ entry: for.cond: ; preds = %for.inc, %entry %tmp1 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %tmp = add i32 %tmp1, -1 - %arrayidx4 = getelementptr [100 x i32], [100 x i32]* @A, i32 0, i32 %tmp - %arrayidx = getelementptr [100 x i32], [100 x i32]* @A, i32 0, i32 %tmp1 + %arrayidx4 = getelementptr [100 x i32], ptr @A, i32 0, i32 %tmp + %arrayidx = getelementptr [100 x i32], ptr @A, i32 0, i32 %tmp1 %exitcond = icmp ne i32 %tmp1, 12 br i1 %exitcond, label %for.body, label %for.end for.body: ; preds = %for.cond - %tmp2 = load i32, i32* %arrayidx, align 4 - %tmp5 = load i32, i32* %arrayidx4, align 4 + %tmp2 = load i32, ptr %arrayidx, align 4 + %tmp5 = load i32, ptr %arrayidx4, align 4 %add = add nsw i32 %tmp2, %tmp5 - store i32 %add, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i32 0, i32 13), align 4 + store i32 %add, ptr getelementptr inbounds ([100 x i32], ptr @A, i32 0, i32 13), align 4 br label %for.inc for.inc: ; preds = %for.body @@ -39,4 +39,4 @@ for.inc: ; preds = %for.body for.end: ; preds = %for.cond ret i32 0 } -; CHECK: load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0) +; CHECK: load i32, ptr @A diff --git a/polly/test/CodeGen/MemAccess/codegen_simple_float.ll b/polly/test/CodeGen/MemAccess/codegen_simple_float.ll index b1a46e7b80f4..65a2d3b9067b 100644 --- a/polly/test/CodeGen/MemAccess/codegen_simple_float.ll +++ b/polly/test/CodeGen/MemAccess/codegen_simple_float.ll @@ -1,4 +1,4 @@ -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s ; ;float A[100]; ; @@ -19,16 +19,16 @@ entry: for.cond: ; preds = %for.inc, %entry %tmp1 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %tmp = add i32 %tmp1, -1 - %arrayidx4 = getelementptr [100 x float], [100 x float]* @A, i32 0, i32 %tmp - %arrayidx = getelementptr [100 x float], [100 x float]* @A, i32 0, i32 %tmp1 + %arrayidx4 = getelementptr [100 x float], ptr @A, i32 0, i32 %tmp + %arrayidx = getelementptr [100 x float], ptr @A, i32 0, i32 %tmp1 %exitcond = icmp ne i32 %tmp1, 12 br i1 %exitcond, label %for.body, label %for.end for.body: ; preds = %for.cond - %tmp2 = load float, float* %arrayidx, align 4 - %tmp5 = load float, float* %arrayidx4, align 4 + %tmp2 = load float, ptr %arrayidx, align 4 + %tmp5 = load float, ptr %arrayidx4, align 4 %add = fadd float %tmp2, %tmp5 - store float %add, float* getelementptr inbounds ([100 x float], [100 x float]* @A, i32 0, i32 13), align 4 + store float %add, ptr getelementptr inbounds ([100 x float], ptr @A, i32 0, i32 13), align 4 br label %for.inc for.inc: ; preds = %for.body @@ -38,4 +38,4 @@ for.inc: ; preds = %for.body for.end: ; preds = %for.cond ret i32 0 } -; CHECK: load float, float* getelementptr inbounds ([100 x float], [100 x float]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0) +; CHECK: load float, ptr @A diff --git a/polly/test/CodeGen/MemAccess/codegen_simple_md.ll b/polly/test/CodeGen/MemAccess/codegen_simple_md.ll index 987f113007dd..e4afcc8d2243 100644 --- a/polly/test/CodeGen/MemAccess/codegen_simple_md.ll +++ b/polly/test/CodeGen/MemAccess/codegen_simple_md.ll @@ -1,5 +1,5 @@ -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHCONST %s -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHOUTCONST %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHCONST %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHOUTCONST %s ;int A[1040]; ; @@ -35,8 +35,8 @@ for.cond1: ; preds = %for.inc, %for.body for.body3: ; preds = %for.cond1 %mul = shl nsw i32 %i.0, 5 %add = add nsw i32 %mul, %j.0 - %arrayidx = getelementptr inbounds [1040 x i32], [1040 x i32]* @A, i32 0, i32 %add - store i32 100, i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1040 x i32], ptr @A, i32 0, i32 %add + store i32 100, ptr %arrayidx, align 4 br label %for.inc for.inc: ; preds = %for.body3 @@ -60,13 +60,13 @@ for.end6: ; preds = %for.cond ; WITHCONST: %[[MUL2:[._a-zA-Z0-9]+]] = mul nsw i64 2, %[[IVIn]] ; WITHCONST: %[[SUM1:[._a-zA-Z0-9]+]] = add nsw i64 %[[MUL1]], %[[MUL2]] ; WITHCONST: %[[SUM2:[._a-zA-Z0-9]+]] = add nsw i64 %[[SUM1]], 5 -; WITHCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr i32, i32* getelementptr inbounds ([1040 x i32], [1040 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0), i64 %[[SUM2]] -; WITHCONST: store i32 100, i32* %[[ACC]] +; WITHCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr i32, ptr @A, i64 %[[SUM2]] +; WITHCONST: store i32 100, ptr %[[ACC]] ; WITHOUTCONST: %[[IVOut:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ] ; WITHOUTCONST: %[[IVIn:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ] ; WITHOUTCONST: %[[MUL1:[._a-zA-Z0-9]+]] = mul nsw i64 16, %[[IVOut]] ; WITHOUTCONST: %[[MUL2:[._a-zA-Z0-9]+]] = mul nsw i64 2, %[[IVIn]] ; WITHOUTCONST: %[[SUM1:[._a-zA-Z0-9]+]] = add nsw i64 %[[MUL1]], %[[MUL2]] -; WITHOUTCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr i32, i32* getelementptr inbounds ([1040 x i32], [1040 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0), i64 %[[SUM1]] -; WITHOUTCONST: store i32 100, i32* %[[ACC]] +; WITHOUTCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr i32, ptr @A, i64 %[[SUM1]] +; WITHOUTCONST: store i32 100, ptr %[[ACC]] diff --git a/polly/test/CodeGen/MemAccess/codegen_simple_md_float.ll b/polly/test/CodeGen/MemAccess/codegen_simple_md_float.ll index fb8ee4eaebc4..c9913f3ed873 100644 --- a/polly/test/CodeGen/MemAccess/codegen_simple_md_float.ll +++ b/polly/test/CodeGen/MemAccess/codegen_simple_md_float.ll @@ -1,5 +1,5 @@ -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHCONST %s -;RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHOUTCONST %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHCONST %s +;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHOUTCONST %s ; ;float A[1040]; ; @@ -32,8 +32,8 @@ for.cond1: ; preds = %for.inc, %for.body for.body3: ; preds = %for.cond1 %mul = shl nsw i32 %i.0, 5 %add = add nsw i32 %mul, %j.0 - %arrayidx = getelementptr inbounds [1040 x float], [1040 x float]* @A, i32 0, i32 %add - store float 100.0, float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1040 x float], ptr @A, i32 0, i32 %add + store float 100.0, ptr %arrayidx, align 4 br label %for.inc for.inc: ; preds = %for.body3 @@ -57,13 +57,13 @@ for.end6: ; preds = %for.cond ; WITHCONST: %[[MUL2:[._a-zA-Z0-9]+]] = mul nsw i64 2, %[[IVIn]] ; WITHCONST: %[[SUM1:[._a-zA-Z0-9]+]] = add nsw i64 %[[MUL1]], %[[MUL2]] ; WITHCONST: %[[SUM2:[._a-zA-Z0-9]+]] = add nsw i64 %[[SUM1]], 5 -; WITHCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr float, float* getelementptr inbounds ([1040 x float], [1040 x float]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0), i64 %[[SUM2]] -; WITHCONST: store float 1.000000e+02, float* %[[ACC]] +; WITHCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr float, ptr @A, i64 %[[SUM2]] +; WITHCONST: store float 1.000000e+02, ptr %[[ACC]] ; WITHOUTCONST: %[[IVOut:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ] ; WITHOUTCONST: %[[IVIn:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ] ; WITHOUTCONST: %[[MUL1:[._a-zA-Z0-9]+]] = mul nsw i64 16, %[[IVOut]] ; WITHOUTCONST: %[[MUL2:[._a-zA-Z0-9]+]] = mul nsw i64 2, %[[IVIn]] ; WITHOUTCONST: %[[SUM1:[._a-zA-Z0-9]+]] = add nsw i64 %[[MUL1]], %[[MUL2]] -; WITHOUTCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr float, float* getelementptr inbounds ([1040 x float], [1040 x float]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0), i64 %[[SUM1]] -; WITHOUTCONST: store float 1.000000e+02, float* %[[ACC]] +; WITHOUTCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr float, ptr @A, i64 %[[SUM1]] +; WITHOUTCONST: store float 1.000000e+02, ptr %[[ACC]] diff --git a/polly/test/CodeGen/MemAccess/create_arrays.ll b/polly/test/CodeGen/MemAccess/create_arrays.ll index 07afc7f230d1..b454e028b982 100644 --- a/polly/test/CodeGen/MemAccess/create_arrays.ll +++ b/polly/test/CodeGen/MemAccess/create_arrays.ll @@ -1,5 +1,5 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-print-scops -polly-print-import-jscop -polly-import-jscop-postfix=transformed -disable-output < %s 2>&1 | FileCheck %s -; RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s 2>&1 | FileCheck %s --check-prefix=CODEGEN +; RUN: opt %loadPolly -polly-print-scops -polly-print-import-jscop -polly-import-jscop-postfix=transformed -disable-output < %s 2>&1 | FileCheck %s +; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s 2>&1 | FileCheck %s --check-prefix=CODEGEN ; ; for (i = 0; i < _PB_NI; i++) ; for (j = 0; j < _PB_NJ; j++) @@ -17,7 +17,7 @@ ; ; CHECK:New access function '{ Stmt_bb12[i0, i1, i2] -> E[i2, i0] }' detected in JSCOP file ; -; CODEGEN:define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, [1056 x double]* %A, [1024 x double]* %B, [1056 x double]* %arg7) #0 { +; CODEGEN:define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, ptr %A, ptr %B, ptr %arg7) #0 { ; CODEGEN:bb: ; CODEGEN: %beta.s2a = alloca double ; CODEGEN: %D = alloca [270336 x double] @@ -25,12 +25,11 @@ ; CODEGEN: %F = alloca [270336 x i64] ; CODEGEN: br label %bb8 ; -; CODEGEN: %beta.s2a.reload = load double, double* %beta.s2a -; CODEGEN: %polly.access.cast.E = bitcast [270336 x [200000 x double]]* %E to double* -; CODEGEN: %polly.access.mul.E = mul nsw i64 %polly.indvar33, 200000 +; CODEGEN: %beta.s2a.reload = load double, ptr %beta.s2a +; CODEGEN: %polly.access.mul.E = mul nsw i64 %polly.indvar31, 200000 ; CODEGEN: %polly.access.add.E = add nsw i64 %polly.access.mul.E, %polly.indvar -; CODEGEN: {{%.*}} = load double, double* %polly.access.E, align 8, !alias.scope !0, !noalias !3 -; CODEGEN: store double {{%.*}}, double* %scevgep36, align 8, !alias.scope !8, !noalias !9 +; CODEGEN: {{%.*}} = load double, ptr %polly.access.E, align 8, !alias.scope !0, !noalias !3 +; CODEGEN: store double {{%.*}}, ptr %scevgep34, align 8, !alias.scope !8, !noalias !9 ; ; CODEGEN: !0 = !{!1} ; CODEGEN: !1 = distinct !{!1, !2, !"polly.alias.scope.E"} @@ -47,7 +46,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-unknown" ; Function Attrs: nounwind uwtable -define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, [1056 x double]* %A, [1024 x double]* %B, [1056 x double]* %arg7) #0 { +define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, ptr %A, ptr %B, ptr %arg7) #0 { bb: br label %bb8 @@ -64,11 +63,11 @@ bb10: ; preds = %bb20, %bb9 bb12: ; preds = %bb12, %bb10 %tmp13 = phi i64 [ 0, %bb10 ], [ %tmp18, %bb12 ] - %tmp14 = getelementptr inbounds [1024 x double], [1024 x double]* %B, i64 %tmp, i64 %tmp13 - %tmp15 = load double, double* %tmp14, align 8 + %tmp14 = getelementptr inbounds [1024 x double], ptr %B, i64 %tmp, i64 %tmp13 + %tmp15 = load double, ptr %tmp14, align 8 %tmp16 = fmul double %tmp15, %beta - %tmp17 = getelementptr inbounds [1056 x double], [1056 x double]* %A, i64 %tmp, i64 %tmp11 - store double %tmp16, double* %tmp17, align 8 + %tmp17 = getelementptr inbounds [1056 x double], ptr %A, i64 %tmp, i64 %tmp11 + store double %tmp16, ptr %tmp17, align 8 %tmp18 = add nuw nsw i64 %tmp13, 1 %tmp19 = icmp ne i64 %tmp18, 1024 br i1 %tmp19, label %bb12, label %bb20 diff --git a/polly/test/CodeGen/MemAccess/create_arrays_heap.ll b/polly/test/CodeGen/MemAccess/create_arrays_heap.ll index ff500d0ea7b7..ada9bd98d761 100644 --- a/polly/test/CodeGen/MemAccess/create_arrays_heap.ll +++ b/polly/test/CodeGen/MemAccess/create_arrays_heap.ll @@ -1,5 +1,5 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-stmt-granularity=bb -polly-print-scops -polly-print-import-jscop -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck %s -; RUN: opt -opaque-pointers=0 %loadPolly -polly-stmt-granularity=bb -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN +; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-scops -polly-print-import-jscop -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck %s +; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN ; ; #define Ni 1056 ; #define Nj 1056 @@ -31,27 +31,21 @@ ; %E : size(E) = 270336*200000*8 = 432537600000 cast to double* ; %F : size(F) = 270336*8 = 2162688 cast to i64* ; CODEGEN: polly.start: -; CODEGEN: %malloccall = tail call i8* @malloc(i64 2162688) -; CODEGEN: %D = bitcast i8* %malloccall to double* -; CODEGEN: %malloccall1 = tail call i8* @malloc(i64 432537600000) -; CODEGEN: %E = bitcast i8* %malloccall1 to double* -; CODEGEN: %malloccall2 = tail call i8* @malloc(i64 2162688) -; CODEGEN: %F = bitcast i8* %malloccall2 to i64* +; CODEGEN: %malloccall = tail call ptr @malloc(i64 2162688) +; CODEGEN: %malloccall1 = tail call ptr @malloc(i64 432537600000) +; CODEGEN: %malloccall2 = tail call ptr @malloc(i64 2162688) ; ; Check if there are the 3 expected malloc calls with the right parameters at polly.exiting. ; Cast to i8* before freeing because malloc give us a i8 and free is waiting for a i8* ; CODEGEN: polly.exiting: -; CODEGEN: %12 = bitcast double* %D to i8* -; CODEGEN: tail call void @free(i8* %12) -; CODEGEN: %13 = bitcast double* %E to i8* -; CODEGEN: tail call void @free(i8* %13) -; CODEGEN: %14 = bitcast i64* %F to i8* -; CODEGEN: tail call void @free(i8* %14) +; CODEGEN: tail call void @free(ptr %malloccall) +; CODEGEN: tail call void @free(ptr %malloccall1) +; CODEGEN: tail call void @free(ptr %malloccall2) ; ; Check if the new access for array E is present. -; CODEGEN: %polly.access.mul.E = mul nsw i64 %polly.indvar, 200000 -; CODEGEN: %polly.access.add.E = add nsw i64 %polly.access.mul.E, % -; CODEGEN: %polly.access.E = getelementptr double, double* %E, i64 %polly.access.add.E +; CODEGEN: %polly.access.mul.{{.*}} = mul nsw i64 %polly.indvar, 200000 +; CODEGEN: %polly.access.add.{{.*}} = add nsw i64 %polly.access.mul.{{.*}}, % +; CODEGEN: %polly.access.{{.*}} = getelementptr double, ptr %malloccall1, i64 %polly.access.add.{{.*}} ; ; ModuleID = 'create_arrays_heap.ll' ; @@ -59,7 +53,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable -define void @create_arrays_heap(double %beta, [1024 x double]* nocapture readonly %A, [1056 x double]* nocapture %B) local_unnamed_addr { +define void @create_arrays_heap(double %beta, ptr nocapture readonly %A, ptr nocapture %B) local_unnamed_addr { entry: br label %for.cond1.preheader @@ -69,30 +63,30 @@ for.cond1.preheader: ; preds = %for.inc16, %entry for.cond4.preheader: ; preds = %for.inc13, %for.cond1.preheader %indvars.iv32 = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next33, %for.inc13 ] - %arrayidx12 = getelementptr inbounds [1056 x double], [1056 x double]* %B, i64 %indvars.iv35, i64 %indvars.iv32 + %arrayidx12 = getelementptr inbounds [1056 x double], ptr %B, i64 %indvars.iv35, i64 %indvars.iv32 br label %for.body6 for.body6: ; preds = %for.body6, %for.cond4.preheader %indvars.iv = phi i64 [ 0, %for.cond4.preheader ], [ %indvars.iv.next.3, %for.body6 ] - %arrayidx8 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv - %0 = load double, double* %arrayidx8, align 8 + %arrayidx8 = getelementptr inbounds [1024 x double], ptr %A, i64 %indvars.iv35, i64 %indvars.iv + %0 = load double, ptr %arrayidx8, align 8 %mul = fmul double %0, %beta - store double %mul, double* %arrayidx12, align 8 + store double %mul, ptr %arrayidx12, align 8 %indvars.iv.next = or i64 %indvars.iv, 1 - %arrayidx8.1 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv.next - %1 = load double, double* %arrayidx8.1, align 8 + %arrayidx8.1 = getelementptr inbounds [1024 x double], ptr %A, i64 %indvars.iv35, i64 %indvars.iv.next + %1 = load double, ptr %arrayidx8.1, align 8 %mul.1 = fmul double %1, %beta - store double %mul.1, double* %arrayidx12, align 8 + store double %mul.1, ptr %arrayidx12, align 8 %indvars.iv.next.1 = or i64 %indvars.iv, 2 - %arrayidx8.2 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv.next.1 - %2 = load double, double* %arrayidx8.2, align 8 + %arrayidx8.2 = getelementptr inbounds [1024 x double], ptr %A, i64 %indvars.iv35, i64 %indvars.iv.next.1 + %2 = load double, ptr %arrayidx8.2, align 8 %mul.2 = fmul double %2, %beta - store double %mul.2, double* %arrayidx12, align 8 + store double %mul.2, ptr %arrayidx12, align 8 %indvars.iv.next.2 = or i64 %indvars.iv, 3 - %arrayidx8.3 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv.next.2 - %3 = load double, double* %arrayidx8.3, align 8 + %arrayidx8.3 = getelementptr inbounds [1024 x double], ptr %A, i64 %indvars.iv35, i64 %indvars.iv.next.2 + %3 = load double, ptr %arrayidx8.3, align 8 %mul.3 = fmul double %3, %beta - store double %mul.3, double* %arrayidx12, align 8 + store double %mul.3, ptr %arrayidx12, align 8 %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4 %exitcond.3 = icmp eq i64 %indvars.iv.next.3, 1024 br i1 %exitcond.3, label %for.inc13, label %for.body6 diff --git a/polly/test/CodeGen/MemAccess/different_types.ll b/polly/test/CodeGen/MemAccess/different_types.ll index 91bafcd11984..624de62911ff 100644 --- a/polly/test/CodeGen/MemAccess/different_types.ll +++ b/polly/test/CodeGen/MemAccess/different_types.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop \ +; RUN: opt %loadPolly -polly-import-jscop \ ; RUN: \ ; RUN: -polly-codegen -S < %s | FileCheck %s ; @@ -9,16 +9,14 @@ ; A[i] += 10; ; } -; CHECK: %polly.access.cast.A14 = bitcast float* %A to i32* -; CHECK: %[[R1:[._0-9]*]] = sub nsw i64 0, %polly.indvar11 +; CHECK: %[[R1:[._0-9]*]] = sub nsw i64 0, %polly.indvar7 ; CHECK: %[[R2:[._0-9]*]] = add nsw i64 %[[R1]], 99 -; CHECK: %polly.access.A15 = getelementptr i32, i32* %polly.access.cast.A14, i64 %[[R2]] -; CHECK: %[[R3:[._0-9]*]] = bitcast i32* %polly.access.A15 to float* -; CHECK: %tmp14_p_scalar_ = load float, float* %[[R3]], align 4, !alias.scope !3, !noalias !0 +; CHECK: %polly.access.A10 = getelementptr i32, ptr %A, i64 %[[R2]] +; CHECK: %tmp14_p_scalar_ = load float, ptr %polly.access.A10, align 4, !alias.scope !3, !noalias !0 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @different_types(float* %A, float* %B) { +define void @different_types(ptr %A, ptr %B) { bb: br label %bb2 @@ -28,12 +26,10 @@ bb2: ; preds = %bb8, %bb br i1 %exitcond1, label %bb3, label %bb10 bb3: ; preds = %bb2 - %tmp = getelementptr inbounds float, float* %B, i64 %i.0 - %tmp4 = bitcast float* %tmp to i32* - %tmp5 = load i32, i32* %tmp4, align 4 - %tmp6 = getelementptr inbounds float, float* %A, i64 %i.0 - %tmp7 = bitcast float* %tmp6 to i32* - store i32 %tmp5, i32* %tmp7, align 4 + %tmp = getelementptr inbounds float, ptr %B, i64 %i.0 + %tmp5 = load i32, ptr %tmp, align 4 + %tmp6 = getelementptr inbounds float, ptr %A, i64 %i.0 + store i32 %tmp5, ptr %tmp6, align 4 br label %bb8 bb8: ; preds = %bb3 @@ -49,10 +45,10 @@ bb11: ; preds = %bb16, %bb10 br i1 %exitcond, label %bb12, label %bb18 bb12: ; preds = %bb11 - %tmp13 = getelementptr inbounds float, float* %A, i64 %i1.0 - %tmp14 = load float, float* %tmp13, align 4 + %tmp13 = getelementptr inbounds float, ptr %A, i64 %i1.0 + %tmp14 = load float, ptr %tmp13, align 4 %tmp15 = fadd float %tmp14, 1.000000e+01 - store float %tmp15, float* %tmp13, align 4 + store float %tmp15, ptr %tmp13, align 4 br label %bb16 bb16: ; preds = %bb12 diff --git a/polly/test/CodeGen/MemAccess/generate-all.ll b/polly/test/CodeGen/MemAccess/generate-all.ll index 8da2b0ed12eb..6f92ba13587e 100644 --- a/polly/test/CodeGen/MemAccess/generate-all.ll +++ b/polly/test/CodeGen/MemAccess/generate-all.ll @@ -1,6 +1,6 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-codegen-generate-expressions=false \ +; RUN: opt %loadPolly -polly-codegen -polly-codegen-generate-expressions=false \ ; RUN: -S < %s | FileCheck %s -check-prefix=SCEV -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -polly-codegen-generate-expressions=true \ +; RUN: opt %loadPolly -polly-codegen -polly-codegen-generate-expressions=true \ ; RUN: -S < %s | FileCheck %s -check-prefix=ASTEXPR ; ; void foo(float A[]) { @@ -11,29 +11,30 @@ ; SCEV: polly.stmt.bb2: ; preds = %polly.loop_header ; SCEV-NEXT: %0 = trunc i64 %polly.indvar to i2 ; SCEV-NEXT: %1 = zext i2 %0 to i64 -; SCEV-NEXT: %scevgep = getelementptr float, float* %A, i64 %1 -; SCEV-NEXT: %tmp4_p_scalar_ = load float, float* %scevgep, align 4, !alias.scope !0, !noalias !3 +; SCEV-NEXT: %2 = shl nuw nsw i64 %1, 2 +; SCEV-NEXT: %scevgep = getelementptr i8, ptr %A, i64 %2 +; SCEV-NEXT: %tmp4_p_scalar_ = load float, ptr %scevgep, align 4, !alias.scope !0, !noalias !3 ; SCEV-NEXT: %p_tmp5 = fadd float %tmp4_p_scalar_, 1.000000e+01 -; SCEV-NEXT: store float %p_tmp5, float* %scevgep, align 4, !alias.scope !0, !noalias !3 +; SCEV-NEXT: store float %p_tmp5, ptr %scevgep, align 4, !alias.scope !0, !noalias !3 ; SCEV-NEXT: %polly.indvar_next = add nsw i64 %polly.indvar, 1 ; SCEV-NEXT: %polly.loop_cond = icmp sle i64 %polly.indvar_next, 99 ; SCEV-NEXT: br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit ; ASTEXPR: polly.stmt.bb2: ; preds = %polly.loop_header ; ASTEXPR-NEXT: %pexp.pdiv_r = urem i64 %polly.indvar, 4 -; ASTEXPR-NEXT: %polly.access.A = getelementptr float, float* %A, i64 %pexp.pdiv_r -; ASTEXPR-NEXT: %tmp4_p_scalar_ = load float, float* %polly.access.A, align 4, !alias.scope !0, !noalias !3 +; ASTEXPR-NEXT: %polly.access.A = getelementptr float, ptr %A, i64 %pexp.pdiv_r +; ASTEXPR-NEXT: %tmp4_p_scalar_ = load float, ptr %polly.access.A, align 4, !alias.scope !0, !noalias !3 ; ASTEXPR-NEXT: %p_tmp5 = fadd float %tmp4_p_scalar_, 1.000000e+01 ; ASTEXPR-NEXT: %pexp.pdiv_r1 = urem i64 %polly.indvar, 4 -; ASTEXPR-NEXT: %polly.access.A2 = getelementptr float, float* %A, i64 %pexp.pdiv_r1 -; ASTEXPR-NEXT: store float %p_tmp5, float* %polly.access.A2, align 4, !alias.scope !0, !noalias !3 +; ASTEXPR-NEXT: %polly.access.A2 = getelementptr float, ptr %A, i64 %pexp.pdiv_r1 +; ASTEXPR-NEXT: store float %p_tmp5, ptr %polly.access.A2, align 4, !alias.scope !0, !noalias !3 ; ASTEXPR-NEXT: %polly.indvar_next = add nsw i64 %polly.indvar, 1 ; ASTEXPR-NEXT: %polly.loop_cond = icmp sle i64 %polly.indvar_next, 99 ; ASTEXPR-NEXT: br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @foo(float* %A) { +define void @foo(ptr %A) { bb: br label %bb1 @@ -44,10 +45,10 @@ bb1: ; preds = %bb6, %bb bb2: ; preds = %bb1 %tmp = srem i64 %i.0, 4 - %tmp3 = getelementptr inbounds float, float* %A, i64 %tmp - %tmp4 = load float, float* %tmp3, align 4 + %tmp3 = getelementptr inbounds float, ptr %A, i64 %tmp + %tmp4 = load float, ptr %tmp3, align 4 %tmp5 = fadd float %tmp4, 1.000000e+01 - store float %tmp5, float* %tmp3, align 4 + store float %tmp5, ptr %tmp3, align 4 br label %bb6 bb6: ; preds = %bb2 diff --git a/polly/test/CodeGen/MemAccess/invariant_base_ptr.ll b/polly/test/CodeGen/MemAccess/invariant_base_ptr.ll index 124a11849b07..a6d1de0aac63 100644 --- a/polly/test/CodeGen/MemAccess/invariant_base_ptr.ll +++ b/polly/test/CodeGen/MemAccess/invariant_base_ptr.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-import-jscop \ +; RUN: opt %loadPolly -polly-import-jscop \ ; RUN: -polly-codegen -polly-invariant-load-hoisting -S \ ; RUN: 2>&1 < %s | FileCheck %s @@ -7,10 +7,10 @@ ; generated when invariant load hoisting is disabled. This test case checks ; that in case invariant load hoisting is enabled, we generate correct code. -; CHECK: %polly.access.polly.access.X.load = getelementptr float, float* %polly.access.X.load, i64 %polly.indvar +; CHECK: %polly.access.polly.access.X.load = getelementptr float, ptr %polly.access.X.load, i64 %polly.indvar -define void @invariant_base_ptr(float* noalias %Array, float** noalias %X, - float* noalias %C) { +define void @invariant_base_ptr(ptr noalias %Array, ptr noalias %X, + ptr noalias %C) { start: br label %loop @@ -22,15 +22,15 @@ loop: br i1 %cmp, label %body, label %exit body: - %gep= getelementptr float, float* %Array, i64 %indvar - store float 42.0, float* %gep + %gep= getelementptr float, ptr %Array, i64 %indvar + store float 42.0, ptr %gep br label %body2 body2: - %Base = load float*, float** %X - %gep2 = getelementptr float, float* %Base, i64 %indvar - %val2 = load float, float* %gep2 - store float %val2, float* %C + %Base = load ptr, ptr %X + %gep2 = getelementptr float, ptr %Base, i64 %indvar + %val2 = load float, ptr %gep2 + store float %val2, ptr %C br label %latch latch: diff --git a/polly/test/CodeGen/MemAccess/invariant_base_ptr___%loop---%exit.jscop b/polly/test/CodeGen/MemAccess/invariant_base_ptr___%loop---%exit.jscop index 94bfb2f59e34..42ca0de578ca 100644 --- a/polly/test/CodeGen/MemAccess/invariant_base_ptr___%loop---%exit.jscop +++ b/polly/test/CodeGen/MemAccess/invariant_base_ptr___%loop---%exit.jscop @@ -8,7 +8,7 @@ { "name" : "MemRef_X", "sizes" : [ "*" ], - "type" : "float*" + "type" : "ptr" }, { "name" : "MemRef_Base", diff --git a/polly/test/CodeGen/MemAccess/map_scalar_access.ll b/polly/test/CodeGen/MemAccess/map_scalar_access.ll index 4c9865797a9f..7c845d4a004f 100644 --- a/polly/test/CodeGen/MemAccess/map_scalar_access.ll +++ b/polly/test/CodeGen/MemAccess/map_scalar_access.ll @@ -1,7 +1,7 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-stmt-granularity=bb -polly-import-jscop-postfix=transformed -polly-print-import-jscop -disable-output < %s | FileCheck %s -; RUN: opt -opaque-pointers=0 %loadPolly -polly-stmt-granularity=bb -polly-import-jscop-postfix=transformed -polly-import-jscop -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN +; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-import-jscop-postfix=transformed -polly-print-import-jscop -disable-output < %s | FileCheck %s +; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-import-jscop-postfix=transformed -polly-import-jscop -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN -define void @map_scalar_access(double* noalias nonnull %A) { +define void @map_scalar_access(ptr noalias nonnull %A) { entry: br label %outer.for @@ -26,8 +26,8 @@ outer.for: br label %reduction.for reduction.exit: - %A_idx = getelementptr inbounds double, double* %A, i32 %j - store double %phi, double* %A_idx + %A_idx = getelementptr inbounds double, ptr %A, i32 %j + store double %phi, ptr %A_idx br label %outer.inc @@ -115,35 +115,35 @@ return: ; CHECK-NEXT: New access function '{ Stmt_reduction_exit[i0] -> MemRef_A[i0] }' detected in JSCOP file ; CODEGEN: polly.stmt.outer.for: -; CODEGEN-NEXT: %polly.access.A[[R0:[0-9]*]] = getelementptr double, double* %A, i64 %polly.indvar -; CODEGEN-NEXT: store double 0.000000e+00, double* %polly.access.A[[R0]] +; CODEGEN-NEXT: %polly.access.A[[R0:[0-9]*]] = getelementptr double, ptr %A, i64 %polly.indvar +; CODEGEN-NEXT: store double 0.000000e+00, ptr %polly.access.A[[R0]] ; CODEGEN-NEXT: br label %polly.cond ; CODEGEN: polly.stmt.reduction.exit: -; CODEGEN-NEXT: %polly.access.A[[R1:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: %polly.access.A[[R1]].reload = load double, double* %polly.access.A[[R1]] -; CODEGEN-NEXT: %polly.access.A[[R2:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: store double %polly.access.A[[R1]].reload, double* %polly.access.A[[R2]] +; CODEGEN-NEXT: %polly.access.A[[R1:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: %polly.access.A[[R1]].reload = load double, ptr %polly.access.A[[R1]] +; CODEGEN-NEXT: %polly.access.A[[R2:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: store double %polly.access.A[[R1]].reload, ptr %polly.access.A[[R2]] ; CODEGEN-NEXT: br label %polly.merge ; CODEGEN: polly.stmt.reduction.for: -; CODEGEN-NEXT: %polly.access.A[[R3:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: %polly.access.A[[R3]].reload = load double, double* %polly.access.A[[R3]] -; CODEGEN-NEXT: %polly.access.A[[R4:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: store double %polly.access.A[[R3]].reload, double* %polly.access.A[[R4]] +; CODEGEN-NEXT: %polly.access.A[[R3:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: %polly.access.A[[R3]].reload = load double, ptr %polly.access.A[[R3]] +; CODEGEN-NEXT: %polly.access.A[[R4:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: store double %polly.access.A[[R3]].reload, ptr %polly.access.A[[R4]] ; CODEGEN-NEXT: br label %polly.cond9 ; CODEGEN: polly.stmt.body: -; CODEGEN-NEXT: %polly.access.A[[R5:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: %polly.access.A[[R5]].reload = load double, double* %polly.access.A[[R5]] +; CODEGEN-NEXT: %polly.access.A[[R5:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: %polly.access.A[[R5]].reload = load double, ptr %polly.access.A[[R5]] ; CODEGEN-NEXT: %p_add = fadd double %polly.access.A13.reload, 4.200000e+00 -; CODEGEN-NEXT: %polly.access.A[[R6:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: store double %p_add, double* %polly.access.A[[R6]] +; CODEGEN-NEXT: %polly.access.A[[R6:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: store double %p_add, ptr %polly.access.A[[R6]] ; CODEGEN-NEXT: br label %polly.stmt.reduction.inc ; CODEGEN: polly.stmt.reduction.inc: -; CODEGEN-NEXT: %polly.access.A[[R7:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: %polly.access.A[[R7]].reload = load double, double* %polly.access.A[[R7]] -; CODEGEN-NEXT: %polly.access.A[[R8:[0-9]*]] = getelementptr double, double* %A, i64 0 -; CODEGEN-NEXT: store double %polly.access.A[[R7]].reload, double* %polly.access.A[[R8]] +; CODEGEN-NEXT: %polly.access.A[[R7:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: %polly.access.A[[R7]].reload = load double, ptr %polly.access.A[[R7]] +; CODEGEN-NEXT: %polly.access.A[[R8:[0-9]*]] = getelementptr double, ptr %A, i64 0 +; CODEGEN-NEXT: store double %polly.access.A[[R7]].reload, ptr %polly.access.A[[R8]] ; CODEGEN-NEXT: br label %polly.merge10 diff --git a/polly/test/CodeGen/MemAccess/multiple_types.ll b/polly/test/CodeGen/MemAccess/multiple_types.ll index 36aa94ede5d4..1793bd30fc5b 100644 --- a/polly/test/CodeGen/MemAccess/multiple_types.ll +++ b/polly/test/CodeGen/MemAccess/multiple_types.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-stmt-granularity=bb -polly-import-jscop \ +; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-import-jscop \ ; RUN: -polly-allow-differing-element-types \ ; RUN: -polly-codegen -S < %s | FileCheck %s ; @@ -12,24 +12,21 @@ ; } ; Short[0] -; CHECK: %polly.access.Short10 = getelementptr i8, i8* %Short, i64 0 -; CHECK: %24 = bitcast i8* %polly.access.Short10 to i16* -; CHECK: %tmp5_p_scalar_ = load i16, i16* %24 +; CHECK: %polly.access.Short10 = getelementptr i8, ptr %Short, i64 0 +; CHECK: %tmp5_p_scalar_ = load i16, ptr %polly.access.Short10 ; Float[8 * i] -; CHECK: %25 = mul nsw i64 8, %polly.indvar -; CHECK: %polly.access.Float11 = getelementptr i8, i8* %Float, i64 %25 -; CHECK: %26 = bitcast i8* %polly.access.Float11 to float* -; CHECK: %tmp11_p_scalar_ = load float, float* %26 +; CHECK: %24 = mul nsw i64 8, %polly.indvar +; CHECK: %polly.access.Float11 = getelementptr i8, ptr %Float, i64 %24 +; CHECK: %tmp11_p_scalar_ = load float, ptr %polly.access.Float11 ; Double[8] -; CHECK: %polly.access.Double13 = getelementptr i8, i8* %Double, i64 8 -; CHECK: %27 = bitcast i8* %polly.access.Double13 to double* -; CHECK: %tmp17_p_scalar_ = load double, double* %27 +; CHECK: %polly.access.Double13 = getelementptr i8, ptr %Double, i64 8 +; CHECK: %tmp17_p_scalar_ = load double, ptr %polly.access.Double13 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @multiple_types(i8* %Short, i8* %Float, i8* %Double) { +define void @multiple_types(ptr %Short, ptr %Float, ptr %Double) { bb: br label %bb1 @@ -40,26 +37,23 @@ bb1: ; preds = %bb20, %bb bb2: ; preds = %bb1 %tmp = shl nsw i64 %i.0, 1 - %tmp3 = getelementptr inbounds i8, i8* %Short, i64 %tmp - %tmp4 = bitcast i8* %tmp3 to i16* - %tmp5 = load i16, i16* %tmp4, align 2 + %tmp3 = getelementptr inbounds i8, ptr %Short, i64 %tmp + %tmp5 = load i16, ptr %tmp3, align 2 %tmp6 = trunc i16 %tmp5 to i8 - %tmp7 = getelementptr inbounds i8, i8* %Short, i64 %i.0 - store i8 %tmp6, i8* %tmp7, align 1 + %tmp7 = getelementptr inbounds i8, ptr %Short, i64 %i.0 + store i8 %tmp6, ptr %tmp7, align 1 %tmp8 = shl nsw i64 %i.0, 2 - %tmp9 = getelementptr inbounds i8, i8* %Float, i64 %tmp8 - %tmp10 = bitcast i8* %tmp9 to float* - %tmp11 = load float, float* %tmp10, align 4 + %tmp9 = getelementptr inbounds i8, ptr %Float, i64 %tmp8 + %tmp11 = load float, ptr %tmp9, align 4 %tmp12 = fptosi float %tmp11 to i8 - %tmp13 = getelementptr inbounds i8, i8* %Float, i64 %i.0 - store i8 %tmp12, i8* %tmp13, align 1 + %tmp13 = getelementptr inbounds i8, ptr %Float, i64 %i.0 + store i8 %tmp12, ptr %tmp13, align 1 %tmp14 = shl nsw i64 %i.0, 3 - %tmp15 = getelementptr inbounds i8, i8* %Double, i64 %tmp14 - %tmp16 = bitcast i8* %tmp15 to double* - %tmp17 = load double, double* %tmp16, align 8 + %tmp15 = getelementptr inbounds i8, ptr %Double, i64 %tmp14 + %tmp17 = load double, ptr %tmp15, align 8 %tmp18 = fptosi double %tmp17 to i8 - %tmp19 = getelementptr inbounds i8, i8* %Double, i64 %i.0 - store i8 %tmp18, i8* %tmp19, align 1 + %tmp19 = getelementptr inbounds i8, ptr %Double, i64 %i.0 + store i8 %tmp18, ptr %tmp19, align 1 br label %bb20 bb20: ; preds = %bb2 diff --git a/polly/test/CodeGen/RuntimeDebugBuilder/combine_different_values.ll b/polly/test/CodeGen/RuntimeDebugBuilder/combine_different_values.ll index f904b2a652b4..84827dd26049 100644 --- a/polly/test/CodeGen/RuntimeDebugBuilder/combine_different_values.ll +++ b/polly/test/CodeGen/RuntimeDebugBuilder/combine_different_values.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-codegen -S \ +; RUN: opt %loadPolly -polly-codegen -S \ ; RUN: -polly-codegen-add-debug-printing \ ; RUN: -polly-ignore-aliasing < %s | FileCheck %s @@ -51,49 +51,55 @@ ; CHECK: @22 = private unnamed_addr addrspace(4) constant [2 x i8] c"\0A\00" ; CHECK: @23 = private unnamed_addr constant [12 x i8] c"%s%ld%s%f%s\00" -; CHECK: %0 = ptrtoint double* %scevgep to i64 -; CHECK: %1 = call i32 (...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @3, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([11 x i8], [11 x i8] addrspace(4)* @0, i32 0, i32 0), i64 %0, i8 addrspace(4)* getelementptr inbounds ([3 x i8], [3 x i8] addrspace(4)* @1, i32 0, i32 0), double %tmp3_p_scalar_, i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @2, i32 0, i32 0)) -; CHECK: %2 = call i32 @fflush(i8* null) -; CHECK: %scevgep1 = getelementptr i8, i8* %C, i64 %polly.indvar -; CHECK: %tmp5_p_scalar_ = load i8, i8* %scevgep1 -; CHECK: %3 = ptrtoint i8* %scevgep1 to i64 -; CHECK: %4 = sext i8 %tmp5_p_scalar_ to i64 -; CHECK: %5 = call i32 (...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @7, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([11 x i8], [11 x i8] addrspace(4)* @4, i32 0, i32 0), i64 %3, i8 addrspace(4)* getelementptr inbounds ([3 x i8], [3 x i8] addrspace(4)* @5, i32 0, i32 0), i64 %4, i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @6, i32 0, i32 0)) -; CHECK: %6 = call i32 @fflush(i8* null) +; CHECK: %0 = shl nuw nsw i64 %polly.indvar, 3 +; CHECK: %scevgep = getelementptr i8, ptr %B, i64 %0 +; CHECK: %tmp3_p_scalar_ = load double, ptr %scevgep, align 8, !alias.scope !0, !noalias !3 +; CHECK: %1 = ptrtoint ptr %scevgep to i64 +; CHECK: %2 = call i32 (...) @printf(ptr @3, ptr addrspace(4) @0, i64 %1, ptr addrspace(4) @1, double %tmp3_p_scalar_, ptr addrspace(4) @2) +; CHECK: %3 = call i32 @fflush(ptr null) +; CHECK: %scevgep1 = getelementptr i8, ptr %C, i64 %polly.indvar +; CHECK: %tmp5_p_scalar_ = load i8, ptr %scevgep1, align 1, !alias.scope !8, !noalias !9 +; CHECK: %4 = ptrtoint ptr %scevgep1 to i64 +; CHECK: %5 = sext i8 %tmp5_p_scalar_ to i64 +; CHECK: %6 = call i32 (...) @printf(ptr @7, ptr addrspace(4) @4, i64 %4, ptr addrspace(4) @5, i64 %5, ptr addrspace(4) @6) +; CHECK: %7 = call i32 @fflush(ptr null) ; CHECK: %p_tmp6 = sitofp i8 %tmp5_p_scalar_ to double ; CHECK: %p_tmp7 = fadd double %tmp3_p_scalar_, %p_tmp6 -; CHECK: %scevgep2 = getelementptr i32, i32* %D, i64 %polly.indvar -; CHECK: %tmp9_p_scalar_ = load i32, i32* %scevgep2 -; CHECK: %7 = ptrtoint i32* %scevgep2 to i64 -; CHECK: %8 = sext i32 %tmp9_p_scalar_ to i64 -; CHECK: %9 = call i32 (...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @11, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([11 x i8], [11 x i8] addrspace(4)* @8, i32 0, i32 0), i64 %7, i8 addrspace(4)* getelementptr inbounds ([3 x i8], [3 x i8] addrspace(4)* @9, i32 0, i32 0), i64 %8, i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @10, i32 0, i32 0)) -; CHECK: %10 = call i32 @fflush(i8* null) +; CHECK: %8 = shl nuw nsw i64 %polly.indvar, 2 +; CHECK: %scevgep2 = getelementptr i8, ptr %D, i64 %8 +; CHECK: %tmp9_p_scalar_ = load i32, ptr %scevgep2, align 4, !alias.scope !10, !noalias !11 +; CHECK: %9 = ptrtoint ptr %scevgep2 to i64 +; CHECK: %10 = sext i32 %tmp9_p_scalar_ to i64 +; CHECK: %11 = call i32 (...) @printf(ptr @11, ptr addrspace(4) @8, i64 %9, ptr addrspace(4) @9, i64 %10, ptr addrspace(4) @10) +; CHECK: %12 = call i32 @fflush(ptr null) ; CHECK: %p_tmp10 = sitofp i32 %tmp9_p_scalar_ to double ; CHECK: %p_tmp11 = fadd double %p_tmp7, %p_tmp10 -; CHECK: %scevgep3 = getelementptr i64, i64* %E, i64 %polly.indvar -; CHECK: %tmp13_p_scalar_ = load i64, i64* %scevgep3 -; CHECK: %11 = ptrtoint i64* %scevgep3 to i64 -; CHECK: %12 = call i32 (...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @15, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([11 x i8], [11 x i8] addrspace(4)* @12, i32 0, i32 0), i64 %11, i8 addrspace(4)* getelementptr inbounds ([3 x i8], [3 x i8] addrspace(4)* @13, i32 0, i32 0), i64 %tmp13_p_scalar_, i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @14, i32 0, i32 0)) -; CHECK: %13 = call i32 @fflush(i8* null) +; CHECK: %13 = shl nuw nsw i64 %polly.indvar, 3 +; CHECK: %scevgep3 = getelementptr i8, ptr %E, i64 %13 +; CHECK: %tmp13_p_scalar_ = load i64, ptr %scevgep3, align 8, !alias.scope !12, !noalias !13 +; CHECK: %14 = ptrtoint ptr %scevgep3 to i64 +; CHECK: %15 = call i32 (...) @printf(ptr @15, ptr addrspace(4) @12, i64 %14, ptr addrspace(4) @13, i64 %tmp13_p_scalar_, ptr addrspace(4) @14) +; CHECK: %16 = call i32 @fflush(ptr null) ; CHECK: %p_tmp14 = sitofp i64 %tmp13_p_scalar_ to double ; CHECK: %p_tmp15 = fadd double %p_tmp11, %p_tmp14 -; CHECK: %scevgep4 = getelementptr float, float* %A, i64 %polly.indvar -; CHECK: %tmp17_p_scalar_ = load float, float* %scevgep4 -; CHECK: %14 = ptrtoint float* %scevgep4 to i64 -; CHECK: %15 = fpext float %tmp17_p_scalar_ to double -; CHECK: %16 = call i32 (...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @19, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([11 x i8], [11 x i8] addrspace(4)* @16, i32 0, i32 0), i64 %14, i8 addrspace(4)* getelementptr inbounds ([3 x i8], [3 x i8] addrspace(4)* @17, i32 0, i32 0), double %15, i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @18, i32 0, i32 0)) -; CHECK: %17 = call i32 @fflush(i8* null) +; CHECK: %17 = shl nuw nsw i64 %polly.indvar, 2 +; CHECK: %scevgep4 = getelementptr i8, ptr %A, i64 %17 +; CHECK: %tmp17_p_scalar_ = load float, ptr %scevgep4, align 4, !alias.scope !14, !noalias !15 +; CHECK: %18 = ptrtoint ptr %scevgep4 to i64 +; CHECK: %19 = fpext float %tmp17_p_scalar_ to double +; CHECK: %20 = call i32 (...) @printf(ptr @19, ptr addrspace(4) @16, i64 %18, ptr addrspace(4) @17, double %19, ptr addrspace(4) @18) +; CHECK: %21 = call i32 @fflush(ptr null) ; CHECK: %p_tmp18 = fpext float %tmp17_p_scalar_ to double ; CHECK: %p_tmp19 = fadd double %p_tmp18, %p_tmp15 ; CHECK: %p_tmp20 = fptrunc double %p_tmp19 to float -; CHECK: %18 = ptrtoint float* %scevgep4 to i64 -; CHECK: %19 = fpext float %p_tmp20 to double -; CHECK: %20 = call i32 (...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @23, i32 0, i32 0), i8 addrspace(4)* getelementptr inbounds ([11 x i8], [11 x i8] addrspace(4)* @20, i32 0, i32 0), i64 %18, i8 addrspace(4)* getelementptr inbounds ([3 x i8], [3 x i8] addrspace(4)* @21, i32 0, i32 0), double %19, i8 addrspace(4)* getelementptr inbounds ([2 x i8], [2 x i8] addrspace(4)* @22, i32 0, i32 0)) -; CHECK: %21 = call i32 @fflush(i8* null) +; CHECK: %22 = ptrtoint ptr %scevgep4 to i64 +; CHECK: %23 = fpext float %p_tmp20 to double +; CHECK: %24 = call i32 (...) @printf(ptr @23, ptr addrspace(4) @20, i64 %22, ptr addrspace(4) @21, double %23, ptr addrspace(4) @22) +; CHECK: %25 = call i32 @fflush(ptr null) target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -define void @foo(float* noalias %A, double* noalias %B, i8* noalias %C, i32* noalias %D, i64* noalias %E) { +define void @foo(ptr noalias %A, ptr noalias %B, ptr noalias %C, ptr noalias %D, ptr noalias %E) { bb: br label %bb1 @@ -103,26 +109,26 @@ bb1: ; preds = %bb21, %bb br i1 %exitcond, label %bb2, label %bb23 bb2: ; preds = %bb1 - %tmp = getelementptr inbounds double, double* %B, i64 %i.0 - %tmp3 = load double, double* %tmp, align 8 - %tmp4 = getelementptr inbounds i8, i8* %C, i64 %i.0 - %tmp5 = load i8, i8* %tmp4, align 1 + %tmp = getelementptr inbounds double, ptr %B, i64 %i.0 + %tmp3 = load double, ptr %tmp, align 8 + %tmp4 = getelementptr inbounds i8, ptr %C, i64 %i.0 + %tmp5 = load i8, ptr %tmp4, align 1 %tmp6 = sitofp i8 %tmp5 to double %tmp7 = fadd double %tmp3, %tmp6 - %tmp8 = getelementptr inbounds i32, i32* %D, i64 %i.0 - %tmp9 = load i32, i32* %tmp8, align 4 + %tmp8 = getelementptr inbounds i32, ptr %D, i64 %i.0 + %tmp9 = load i32, ptr %tmp8, align 4 %tmp10 = sitofp i32 %tmp9 to double %tmp11 = fadd double %tmp7, %tmp10 - %tmp12 = getelementptr inbounds i64, i64* %E, i64 %i.0 - %tmp13 = load i64, i64* %tmp12, align 8 + %tmp12 = getelementptr inbounds i64, ptr %E, i64 %i.0 + %tmp13 = load i64, ptr %tmp12, align 8 %tmp14 = sitofp i64 %tmp13 to double %tmp15 = fadd double %tmp11, %tmp14 - %tmp16 = getelementptr inbounds float, float* %A, i64 %i.0 - %tmp17 = load float, float* %tmp16, align 4 + %tmp16 = getelementptr inbounds float, ptr %A, i64 %i.0 + %tmp17 = load float, ptr %tmp16, align 4 %tmp18 = fpext float %tmp17 to double %tmp19 = fadd double %tmp18, %tmp15 %tmp20 = fptrunc double %tmp19 to float - store float %tmp20, float* %tmp16, align 4 + store float %tmp20, ptr %tmp16, align 4 br label %bb21 bb21: ; preds = %bb2 @@ -149,16 +155,16 @@ bb1: ; preds = %bb7, %bb bb2: ; preds = %bb1 fence seq_cst - %tmp = getelementptr inbounds [10 x i64], [10 x i64]* %E, i64 0, i64 %i.0 - store i64 42, i64* %tmp, align 8 - %tmp3 = getelementptr inbounds [10 x i32], [10 x i32]* %D, i64 0, i64 %i.0 - store i32 42, i32* %tmp3, align 4 - %tmp4 = getelementptr inbounds [10 x i8], [10 x i8]* %C, i64 0, i64 %i.0 - store i8 42, i8* %tmp4, align 1 - %tmp5 = getelementptr inbounds [10 x double], [10 x double]* %B, i64 0, i64 %i.0 - store double 4.200000e+01, double* %tmp5, align 8 - %tmp6 = getelementptr inbounds [10 x float], [10 x float]* %A, i64 0, i64 %i.0 - store float 4.200000e+01, float* %tmp6, align 4 + %tmp = getelementptr inbounds [10 x i64], ptr %E, i64 0, i64 %i.0 + store i64 42, ptr %tmp, align 8 + %tmp3 = getelementptr inbounds [10 x i32], ptr %D, i64 0, i64 %i.0 + store i32 42, ptr %tmp3, align 4 + %tmp4 = getelementptr inbounds [10 x i8], ptr %C, i64 0, i64 %i.0 + store i8 42, ptr %tmp4, align 1 + %tmp5 = getelementptr inbounds [10 x double], ptr %B, i64 0, i64 %i.0 + store double 4.200000e+01, ptr %tmp5, align 8 + %tmp6 = getelementptr inbounds [10 x float], ptr %A, i64 0, i64 %i.0 + store float 4.200000e+01, ptr %tmp6, align 4 br label %bb7 bb7: ; preds = %bb2 @@ -166,14 +172,14 @@ bb7: ; preds = %bb2 br label %bb1 bb9: ; preds = %bb1 - %tmp10 = getelementptr inbounds [10 x float], [10 x float]* %A, i64 0, i64 0 - %tmp11 = getelementptr inbounds [10 x double], [10 x double]* %B, i64 0, i64 0 - %tmp12 = getelementptr inbounds [10 x i8], [10 x i8]* %C, i64 0, i64 0 - %tmp13 = getelementptr inbounds [10 x i32], [10 x i32]* %D, i64 0, i64 0 - %tmp14 = getelementptr inbounds [10 x i64], [10 x i64]* %E, i64 0, i64 0 - call void @foo(float* %tmp10, double* %tmp11, i8* %tmp12, i32* %tmp13, i64* %tmp14) - %tmp15 = getelementptr inbounds [10 x float], [10 x float]* %A, i64 0, i64 8 - %tmp16 = load float, float* %tmp15, align 16 + %tmp10 = getelementptr inbounds [10 x float], ptr %A, i64 0, i64 0 + %tmp11 = getelementptr inbounds [10 x double], ptr %B, i64 0, i64 0 + %tmp12 = getelementptr inbounds [10 x i8], ptr %C, i64 0, i64 0 + %tmp13 = getelementptr inbounds [10 x i32], ptr %D, i64 0, i64 0 + %tmp14 = getelementptr inbounds [10 x i64], ptr %E, i64 0, i64 0 + call void @foo(ptr %tmp10, ptr %tmp11, ptr %tmp12, ptr %tmp13, ptr %tmp14) + %tmp15 = getelementptr inbounds [10 x float], ptr %A, i64 0, i64 8 + %tmp16 = load float, ptr %tmp15, align 16 %tmp17 = fptosi float %tmp16 to i32 ret i32 %tmp17 } diff --git a/polly/test/ScopDetect/base_pointer_load_is_inst_inside_invariant_1___%for.i---%exit.jscop b/polly/test/ScopDetect/base_pointer_load_is_inst_inside_invariant_1___%for.i---%exit.jscop index bcc3c301cd81..f8c49fcb1e4f 100644 --- a/polly/test/ScopDetect/base_pointer_load_is_inst_inside_invariant_1___%for.i---%exit.jscop +++ b/polly/test/ScopDetect/base_pointer_load_is_inst_inside_invariant_1___%for.i---%exit.jscop @@ -3,7 +3,7 @@ { "name" : "MemRef_A", "sizes" : [ "*" ], - "type" : "float*" + "type" : "ptr" }, { "name" : "MemRef_ptr", diff --git a/polly/test/ScopDetect/base_pointer_load_setNewAccessRelation.ll b/polly/test/ScopDetect/base_pointer_load_setNewAccessRelation.ll index 7d88bbc1d390..0411aed6ae04 100644 --- a/polly/test/ScopDetect/base_pointer_load_setNewAccessRelation.ll +++ b/polly/test/ScopDetect/base_pointer_load_setNewAccessRelation.ll @@ -1,4 +1,4 @@ -; RUN: opt -opaque-pointers=0 %loadPolly -polly-ignore-aliasing -polly-invariant-load-hoisting=true -polly-scops -polly-print-import-jscop -polly-codegen -disable-output < %s | FileCheck %s +; RUN: opt %loadPolly -polly-ignore-aliasing -polly-invariant-load-hoisting=true -polly-scops -polly-print-import-jscop -polly-codegen -disable-output < %s | FileCheck %s ; ; This violated an assertion in setNewAccessRelation that assumed base pointers ; to be load-hoisted. Without this assertion, it codegen would generate invalid @@ -6,7 +6,7 @@ ; 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" -define void @base_pointer_load_is_inst_inside_invariant_1(i64 %n, float** %A) { +define void @base_pointer_load_is_inst_inside_invariant_1(i64 %n, ptr %A) { entry: br label %for.i @@ -15,10 +15,10 @@ for.i: br label %S1 S1: - %ptr = load float*, float** %A + %ptr = load ptr, ptr %A %conv = sitofp i64 %indvar.i to float - %arrayidx5 = getelementptr float, float* %ptr, i64 %indvar.i - store float %conv, float* %arrayidx5, align 4 + %arrayidx5 = getelementptr float, ptr %ptr, i64 %indvar.i + store float %conv, ptr %arrayidx5, align 4 br label %for.i.inc for.i.inc: -- cgit v1.2.1