[llvm] [AMDGPU] Limit promoting allocas that have users with dynamic index above a threshold on number of elements (PR #170327)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 3 00:43:51 PST 2025


================
@@ -920,6 +926,23 @@ bool AMDGPUPromoteAllocaImpl::tryPromoteAllocaToVector(AllocaInst &Alloca) {
       if (!Index)
         return RejectUser(Inst, "cannot compute vector index for GEP");
 
+      if (!isa<ConstantInt>(Index)) {
+        bool UsedInLoad = false;
+        for (auto *U : GEP->users()) {
----------------
perlfu wrote:

Can use `any_of()` here.

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


More information about the llvm-commits mailing list