From 6f5fbca4136364fc8b5074e1c7450f009a94da77 Mon Sep 17 00:00:00 2001 From: Kit Barton Date: Mon, 11 Mar 2024 17:15:27 -0400 Subject: [PATCH 1/2] Add toleration for modules that do not have a quir.nodeType attribute. --- lib/HAL/TargetSystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/HAL/TargetSystem.cpp b/lib/HAL/TargetSystem.cpp index 6948d78db..16893b91f 100644 --- a/lib/HAL/TargetSystem.cpp +++ b/lib/HAL/TargetSystem.cpp @@ -80,6 +80,10 @@ llvm::Expected TargetInstrument::getModule(mlir::ModuleOp parentModuleOp) { for (auto childModuleOp : parentModuleOp.getBody()->getOps()) { + // Check for a QUIR module. If no quir.nodeType, skip this module. + if (!childModuleOp->hasAttrOfType("quir.nodeType")) + continue; + auto moduleNodeType = childModuleOp->getAttrOfType("quir.nodeType"); auto moduleNodeId = mlir::quir::getNodeId(childModuleOp); From c3c64986e27ba535217ae0a18eecc68f96f46f7f Mon Sep 17 00:00:00 2001 From: Kit Barton Date: Tue, 12 Mar 2024 12:21:55 -0400 Subject: [PATCH 2/2] Update comment. Co-authored-by: mbhealy --- lib/HAL/TargetSystem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/HAL/TargetSystem.cpp b/lib/HAL/TargetSystem.cpp index 16893b91f..8993e5187 100644 --- a/lib/HAL/TargetSystem.cpp +++ b/lib/HAL/TargetSystem.cpp @@ -81,6 +81,7 @@ TargetInstrument::getModule(mlir::ModuleOp parentModuleOp) { for (auto childModuleOp : parentModuleOp.getBody()->getOps()) { // Check for a QUIR module. If no quir.nodeType, skip this module. + // This likely indicates it is the `main` module if (!childModuleOp->hasAttrOfType("quir.nodeType")) continue;