MemoryBuiltins: Don't check for unsized allocas
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 16 Nov 2022 15:46:52 +0000 (07:46 -0800)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 16 Nov 2022 17:13:11 +0000 (09:13 -0800)
The verifier rejects these.

llvm/lib/Analysis/MemoryBuiltins.cpp

index 351e81a..1cba057 100644 (file)
@@ -783,9 +783,6 @@ bool ObjectSizeOffsetVisitor::CheckedZextOrTrunc(APInt &I) {
 }
 
 SizeOffsetType ObjectSizeOffsetVisitor::visitAllocaInst(AllocaInst &I) {
-  if (!I.getAllocatedType()->isSized())
-    return unknown();
-
   TypeSize ElemSize = DL.getTypeAllocSize(I.getAllocatedType());
   if (ElemSize.isScalable() && Options.EvalMode != ObjectSizeOpts::Mode::Min)
     return unknown();