[clang] [llvm] [IR] Add TargetExtType::CanBeLocal property (PR #99016)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 04:01:57 PST 2024


================
@@ -4285,6 +4291,12 @@ void Verifier::visitAllocaInst(AllocaInst &AI) {
   SmallPtrSet<Type*, 4> Visited;
   Check(AI.getAllocatedType()->isSized(&Visited),
         "Cannot allocate unsized type", &AI);
+  // Check if it's a target extension type that disallows being used on the
+  // stack.
+  if (auto *TTy = dyn_cast<TargetExtType>(AI.getAllocatedType())) {
+    Check(TTy->hasProperty(TargetExtType::CanBeLocal),
+          "Alloca has illegal target extension type", &AI);
----------------
jayfoad wrote:

I've now added the recursive checks to this patch too.

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


More information about the llvm-commits mailing list