[llvm] [BoundsChecking] Handle vscale allocas (PR #90926)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 18:23:36 PDT 2024


================
@@ -1138,8 +1138,8 @@ SizeOffsetValue ObjectSizeOffsetEvaluator::visitAllocaInst(AllocaInst &I) {
   if (!I.getAllocatedType()->isSized())
     return ObjectSizeOffsetEvaluator::unknown();
 
-  // must be a VLA
-  assert(I.isArrayAllocation());
+  // must be a VLA or vscale.
+  assert(I.isArrayAllocation() || I.getAllocatedType()->isScalableTy());
----------------
fmayer wrote:

Does this mean we were violating this assertion for vscale allocas before this change?

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


More information about the llvm-commits mailing list