[llvm] r364783 - AMDGPU: Fix tests using the default alloca address space
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 08:23:04 PDT 2019
Author: arsenm
Date: Mon Jul 1 08:23:03 2019
New Revision: 364783
URL: http://llvm.org/viewvc/llvm-project?rev=364783&view=rev
Log:
AMDGPU: Fix tests using the default alloca address space
Modified:
llvm/trunk/test/CodeGen/AMDGPU/loop-idiom.ll
llvm/trunk/test/CodeGen/AMDGPU/unroll.ll
Modified: llvm/trunk/test/CodeGen/AMDGPU/loop-idiom.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/loop-idiom.ll?rev=364783&r1=364782&r2=364783&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/loop-idiom.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/loop-idiom.ll Mon Jul 1 08:23:03 2019
@@ -2,6 +2,7 @@
; RUN: opt -basicaa -loop-idiom -S < %s -march=amdgcn -mcpu=tahiti -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
; RUN: opt -basicaa -loop-idiom -S < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
+target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
; Make sure loop-idiom doesn't create memcpy or memset. There are no library
; implementations of these for R600.
@@ -11,15 +12,15 @@
; SI-NOT: {{^}}llvm.memcpy
define amdgpu_kernel void @no_memcpy(i8 addrspace(3)* %in, i32 %size) {
entry:
- %dest = alloca i8, i32 32
+ %dest = alloca i8, i32 32, addrspace(5)
br label %for.body
for.body:
%0 = phi i32 [0, %entry], [%4, %for.body]
%1 = getelementptr i8, i8 addrspace(3)* %in, i32 %0
- %2 = getelementptr i8, i8* %dest, i32 %0
+ %2 = getelementptr i8, i8 addrspace(5)* %dest, i32 %0
%3 = load i8, i8 addrspace(3)* %1
- store i8 %3, i8* %2
+ store i8 %3, i8 addrspace(5)* %2
%4 = add i32 %0, 1
%5 = icmp eq i32 %4, %size
br i1 %5, label %for.end, label %for.body
@@ -35,13 +36,13 @@ for.end:
; SI-NOT: {{^}}memset_pattern16:
define amdgpu_kernel void @no_memset(i32 %size) {
entry:
- %dest = alloca i8, i32 32
+ %dest = alloca i8, i32 32, addrspace(5)
br label %for.body
for.body:
%0 = phi i32 [0, %entry], [%2, %for.body]
- %1 = getelementptr i8, i8* %dest, i32 %0
- store i8 0, i8* %1
+ %1 = getelementptr i8, i8 addrspace(5)* %dest, i32 %0
+ store i8 0, i8 addrspace(5)* %1
%2 = add i32 %0, 1
%3 = icmp eq i32 %2, %size
br i1 %3, label %for.end, label %for.body
Modified: llvm/trunk/test/CodeGen/AMDGPU/unroll.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/unroll.ll?rev=364783&r1=364782&r2=364783&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/unroll.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/unroll.ll Mon Jul 1 08:23:03 2019
@@ -1,6 +1,7 @@
; RUN: opt -mtriple=amdgcn-- -loop-unroll -simplifycfg -sroa %s -S -o - | FileCheck %s
; RUN: opt -mtriple=r600-- -loop-unroll -simplifycfg -sroa %s -S -o - | FileCheck %s
+target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5"
; This test contains a simple loop that initializes an array declared in
; private memory. We want to make sure these kinds of loops are always
@@ -11,7 +12,7 @@
; CHECK: store i32 5, i32 addrspace(1)* %out
define amdgpu_kernel void @private_memory(i32 addrspace(1)* %out) {
entry:
- %0 = alloca [32 x i32]
+ %0 = alloca [32 x i32], addrspace(5)
br label %loop.header
loop.header:
@@ -19,8 +20,8 @@ loop.header:
br label %loop.body
loop.body:
- %ptr = getelementptr [32 x i32], [32 x i32]* %0, i32 0, i32 %counter
- store i32 %counter, i32* %ptr
+ %ptr = getelementptr [32 x i32], [32 x i32] addrspace(5)* %0, i32 0, i32 %counter
+ store i32 %counter, i32 addrspace(5)* %ptr
br label %loop.inc
loop.inc:
@@ -29,8 +30,8 @@ loop.inc:
br i1 %1, label %exit, label %loop.header
exit:
- %2 = getelementptr [32 x i32], [32 x i32]* %0, i32 0, i32 5
- %3 = load i32, i32* %2
+ %2 = getelementptr [32 x i32], [32 x i32] addrspace(5)* %0, i32 0, i32 5
+ %3 = load i32, i32 addrspace(5)* %2
store i32 %3, i32 addrspace(1)* %out
ret void
}
@@ -74,7 +75,7 @@ exit:
; CHECK-NEXT: getelementptr
; CHECK-NEXT: store
; CHECK-NOT: br
-define amdgpu_kernel void @unroll_for_if(i32* %a) {
+define amdgpu_kernel void @unroll_for_if(i32 addrspace(5)* %a) {
entry:
br label %for.body
@@ -86,8 +87,8 @@ for.body:
if.then: ; preds = %for.body
%0 = sext i32 %i1 to i64
- %arrayidx = getelementptr inbounds i32, i32* %a, i64 %0
- store i32 0, i32* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds i32, i32 addrspace(5)* %a, i64 %0
+ store i32 0, i32 addrspace(5)* %arrayidx, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
More information about the llvm-commits
mailing list