[llvm-branch-commits] [llvm] [AMDGPU] PromoteAlloca: split scalar accesses that span several elements (PR #217056)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 21 00:00:37 PDT 2026


================
@@ -652,8 +671,9 @@ static Value *promoteAllocaUserToVector(Instruction *Inst, const DataLayout &DL,
       }
     }
 
-    // Loading a subvector.
-    if (isa<FixedVectorType>(AccessTy)) {
+    // Loading a subvector, or a scalar that spans several elements.
+    if (isa<FixedVectorType>(AccessTy) ||
----------------
ruiling wrote:

might be better to change the condition to `NumLoadedElts > 1`. Just need to hoist its calculation from the if.

https://github.com/llvm/llvm-project/pull/217056


More information about the llvm-branch-commits mailing list