[llvm] [IR] Allow nofree metadata to inttoptr (PR #153149)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 07:09:22 PDT 2025


================
@@ -5022,6 +5023,15 @@ void Verifier::visitDereferenceableMetadata(Instruction& I, MDNode* MD) {
         &I);
 }
 
+void Verifier::visitNofreeMetadata(Instruction &I, MDNode *MD) {
+  Check(I.getType()->isPointerTy(), "nofree applies only to pointer types", &I);
+  Check((isa<IntToPtrInst>(I)),
+        "nofree applies only to inttoptr instruction,"
+        " use attributes for calls or invokes",
----------------
nikic wrote:

Call/invoke do not support a nofree return value attribute right now (only param or function), so I don't think we should mentioned it for now.

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


More information about the llvm-commits mailing list