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

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 18:25:45 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());
----------------
vitalybuka wrote:

Yes, DEBUG crashes here, NDEBUG crashes casting `DL.getTypeAllocSize` to const 

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


More information about the llvm-commits mailing list