diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-27 21:24:57 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-27 21:24:57 +0000 |
commit | 9e93ba225f9f4d0cfab175b73d2a744d01104451 (patch) | |
tree | b7041133944358ba5ef1791bedbf0e963f141ffa /test/Transforms | |
parent | 867c189d891f175969164515c6cb91e4d3650ea6 (diff) | |
download | external_llvm-9e93ba225f9f4d0cfab175b73d2a744d01104451.zip external_llvm-9e93ba225f9f4d0cfab175b73d2a744d01104451.tar.gz external_llvm-9e93ba225f9f4d0cfab175b73d2a744d01104451.tar.bz2 |
Fix SLPVectorizer using wrong address space for load/store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/SLPVectorizer/R600/lit.local.cfg | 4 | ||||
-rw-r--r-- | test/Transforms/SLPVectorizer/R600/simplebb.ll | 65 |
2 files changed, 69 insertions, 0 deletions
diff --git a/test/Transforms/SLPVectorizer/R600/lit.local.cfg b/test/Transforms/SLPVectorizer/R600/lit.local.cfg new file mode 100644 index 0000000..9e0ab99 --- /dev/null +++ b/test/Transforms/SLPVectorizer/R600/lit.local.cfg @@ -0,0 +1,4 @@ +targets = set(config.root.targets_to_build.split()) +if not 'R600' in targets: + config.unsupported = True + diff --git a/test/Transforms/SLPVectorizer/R600/simplebb.ll b/test/Transforms/SLPVectorizer/R600/simplebb.ll new file mode 100644 index 0000000..b6d794b --- /dev/null +++ b/test/Transforms/SLPVectorizer/R600/simplebb.ll @@ -0,0 +1,65 @@ +; RUN: opt -S -march=r600 -mcpu=cayman -basicaa -slp-vectorizer -dce < %s | FileCheck %s + +target datalayout = "e-p:32:32:32-p3:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-v2048:2048:2048-n32:64" + + +; Simple 3-pair chain with loads and stores +define void @test1_as_3_3_3(double addrspace(3)* %a, double addrspace(3)* %b, double addrspace(3)* %c) { +; CHECK-LABEL: @test1_as_3_3_3( +; CHECK: load <2 x double> addrspace(3)* +; CHECK: load <2 x double> addrspace(3)* +; CHECK: store <2 x double> %{{.*}}, <2 x double> addrspace(3)* % +; CHECK: ret + %i0 = load double addrspace(3)* %a, align 8 + %i1 = load double addrspace(3)* %b, align 8 + %mul = fmul double %i0, %i1 + %arrayidx3 = getelementptr inbounds double addrspace(3)* %a, i64 1 + %i3 = load double addrspace(3)* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double addrspace(3)* %b, i64 1 + %i4 = load double addrspace(3)* %arrayidx4, align 8 + %mul5 = fmul double %i3, %i4 + store double %mul, double addrspace(3)* %c, align 8 + %arrayidx5 = getelementptr inbounds double addrspace(3)* %c, i64 1 + store double %mul5, double addrspace(3)* %arrayidx5, align 8 + ret void +} + +define void @test1_as_3_0_0(double addrspace(3)* %a, double* %b, double* %c) { +; CHECK-LABEL: @test1_as_3_0_0( +; CHECK: load <2 x double> addrspace(3)* +; CHECK: load <2 x double>* +; CHECK: store <2 x double> %{{.*}}, <2 x double>* % +; CHECK: ret + %i0 = load double addrspace(3)* %a, align 8 + %i1 = load double* %b, align 8 + %mul = fmul double %i0, %i1 + %arrayidx3 = getelementptr inbounds double addrspace(3)* %a, i64 1 + %i3 = load double addrspace(3)* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double* %b, i64 1 + %i4 = load double* %arrayidx4, align 8 + %mul5 = fmul double %i3, %i4 + store double %mul, double* %c, align 8 + %arrayidx5 = getelementptr inbounds double* %c, i64 1 + store double %mul5, double* %arrayidx5, align 8 + ret void +} + +define void @test1_as_0_0_3(double* %a, double* %b, double addrspace(3)* %c) { +; CHECK-LABEL: @test1_as_0_0_3( +; CHECK: load <2 x double>* +; CHECK: load <2 x double>* +; CHECK: store <2 x double> %{{.*}}, <2 x double> addrspace(3)* % +; CHECK: ret + %i0 = load double* %a, align 8 + %i1 = load double* %b, align 8 + %mul = fmul double %i0, %i1 + %arrayidx3 = getelementptr inbounds double* %a, i64 1 + %i3 = load double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double* %b, i64 1 + %i4 = load double* %arrayidx4, align 8 + %mul5 = fmul double %i3, %i4 + store double %mul, double addrspace(3)* %c, align 8 + %arrayidx5 = getelementptr inbounds double addrspace(3)* %c, i64 1 + store double %mul5, double addrspace(3)* %arrayidx5, align 8 + ret void +} |