[llvm] [GlobalISel] Add SVE support for alloca (PR #178976)

Jameson Nash via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 31 12:40:21 PST 2026


================
@@ -258,14 +258,23 @@ int IRTranslator::getOrCreateFrameIndex(const AllocaInst &AI) {
   if (!Inserted)
     return MapEntry->second;
 
-  uint64_t Size =
-      AI.getAllocationSize(*DL).value_or(TypeSize::getZero()).getFixedValue();
+  TypeSize TySize = AI.getAllocationSize(*DL).value_or(TypeSize::getZero());
+  uint64_t Size = TySize.getKnownMinValue();
 
   // Always allocate at least one byte.
   Size = std::max<uint64_t>(Size, 1u);
 
   int &FI = MapEntry->second;
   FI = MF->getFrameInfo().CreateStackObject(Size, AI.getAlign(), false, &AI);
+
+  // Scalable vectors and structures that contain scalable vectors may
+  // need a special StackID to distinguish them from other (fixed size)
+  // stack objects.
+  if (TySize.isScalable())
----------------
vtjnash wrote:

Deleting it fully is slightly above my pay grade right now (which is zero for llvm haha). I propose we merge this with the feature, to make the isel comparable at this time, then later someone can deal with deleting it. That person could be me to make the PR, but I don't know which stakeholders need to approve the removal to merge it.

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


More information about the llvm-commits mailing list