[PATCH] D50991: [AMDGPU] Consider loads from flat addrspace to be potentially divergent

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 07:37:05 PDT 2018


arsenm added inline comments.


================
Comment at: test/Analysis/DivergenceAnalysis/AMDGPU/divergent-flat.ll:5-12
+; CHECK: DIVERGENT: %val = load i32, i32* %flat, align 4
+define amdgpu_kernel void @spam(i32 addrspace(5)* %priv) {
+  %flat = addrspacecast i32 addrspace(5)* %priv to i32*
+  %idx = call i32 @llvm.amdgcn.workitem.id.x()
+  store i32 %idx, i32* %flat, align 4
+  %val = load i32, i32* %flat, align 4
+  ret void
----------------
You don't need the addrspacecast, and it would be better to just have the argument be flat in the first place. This theoretically could be smarter and say yes in this case


https://reviews.llvm.org/D50991





More information about the llvm-commits mailing list