[PATCH] D103655: [AMDGPU] Handle constant LDS uses from different kernels

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 4 06:44:47 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:266
+        // current kernel.
+        for (Value::user_iterator UI = GV->user_begin(), E = GV->user_end();
+             UI != E;) {
----------------
Can this be `for (auto &U : make_early_inc_range(GV->users()))`?


================
Comment at: llvm/test/CodeGen/AMDGPU/lower-module-lds-constantexpr.ll:43-45
+; CHECK: %4 = bitcast float addrspace(3)* getelementptr inbounds (%llvm.amdgcn.kernel.timestwo.lds.t, %llvm.amdgcn.kernel.timestwo.lds.t addrspace(3)* @llvm.amdgcn.kernel.timestwo.lds, i32 0, i32 0) to i32 addrspace(3)*
+; CHECK: %5 = addrspacecast i32 addrspace(3)* %4 to i32*
+; CHECK: %6 = ptrtoint i32* %5 to i64
----------------
Why do %4, %5, %6 need to be Instructions? Couldn't they could be left as ConstantExprs?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103655/new/

https://reviews.llvm.org/D103655



More information about the llvm-commits mailing list