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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 03:52:02 PDT 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:

Yeah, I asked about that here: https://discourse.llvm.org/t/rfc-adding-opaque-types-to-llvm-ir/65326/25

I might work on it but I want to keep that separate.

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


More information about the llvm-commits mailing list