[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:37 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
----------------
arsenm wrote:
> 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
Also it looks like we are missing a test for the private case anyway. Can you just rename the test to loads and add a test for private as well?
https://reviews.llvm.org/D50991
More information about the llvm-commits
mailing list