[Mlir-commits] [mlir] [MLIR] Enable import of non self referential alias scopes (PR #121987)

Tobias Gysi llvmlistbot at llvm.org
Tue Jan 7 11:56:59 PST 2025


================
@@ -452,12 +458,28 @@ ModuleImport::processAliasScopeMetadata(const llvm::MDNode *node) {
       // verifying its domain. Perform the verification before looking it up in
       // the alias scope mapping since it could have been inserted as a domain
       // node before.
-      if (!verifySelfRef(scope) || !domain || !verifyDescription(scope, 2))
-        return emitError(loc) << "unsupported alias scope node: "
+      if (!domain)
+        return emitError(loc) << "unsupported alias scope node (no domain): "
                               << diagMD(scope, llvmModule.get());
-      if (!verifySelfRef(domain) || !verifyDescription(domain, 1))
-        return emitError(loc) << "unsupported alias domain node: "
-                              << diagMD(domain, llvmModule.get());
+      if (verifySelfRef(scope) && !verifyDescription(scope, 2))
----------------
gysit wrote:

I think it would make sense to change `verifySelfRef` so to something like `verifySelfRefOrString` which returns true if the first node is a self ref or a string. That way the verification here can be mostly unchanged?

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


More information about the Mlir-commits mailing list