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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 07:22:40 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:

#116639 does this for `CanBeGlobal`.

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


More information about the llvm-commits mailing list