summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorScott Linder <scott@scottlinder.com>2018-08-21 21:24:31 +0000
committerScott Linder <scott@scottlinder.com>2018-08-21 21:24:31 +0000
commit72855e36c59c089b5aa5b83017f5957644011679 (patch)
treed5cb831866c9a5c23a365a906d67f662a79b162a /llvm/test
parentfaef7d034a9ec6cb757137adce8e8670ec6c2d7b (diff)
downloadbcm5719-llvm-72855e36c59c089b5aa5b83017f5957644011679.tar.gz
bcm5719-llvm-72855e36c59c089b5aa5b83017f5957644011679.zip
[AMDGPU] Consider loads from flat addrspace to be potentially divergent
In general we can't assume flat loads are uniform, and cases where we can prove they are should be handled through infer-address-spaces. Differential Revision: https://reviews.llvm.org/D50991 llvm-svn: 340343
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Analysis/DivergenceAnalysis/AMDGPU/loads.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Analysis/DivergenceAnalysis/AMDGPU/loads.ll b/llvm/test/Analysis/DivergenceAnalysis/AMDGPU/loads.ll
new file mode 100644
index 00000000000..51be053e9dd
--- /dev/null
+++ b/llvm/test/Analysis/DivergenceAnalysis/AMDGPU/loads.ll
@@ -0,0 +1,15 @@
+; RUN: opt -mtriple=amdgcn-- -analyze -divergence %s | FileCheck %s
+
+; Test that we consider loads from flat and private addrspaces to be divergent.
+
+; CHECK: DIVERGENT: %val = load i32, i32* %flat, align 4
+define amdgpu_kernel void @flat_load(i32* %flat) {
+ %val = load i32, i32* %flat, align 4
+ ret void
+}
+
+; CHECK: DIVERGENT: %val = load i32, i32 addrspace(5)* %priv, align 4
+define amdgpu_kernel void @private_load(i32 addrspace(5)* %priv) {
+ %val = load i32, i32 addrspace(5)* %priv, align 4
+ ret void
+}
OpenPOWER on IntegriCloud