[clang] [mlir] [CIR][OpenMP] Add host op filtering pass to CIR pipeline (PR #209592)

Sergio Afonso via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 06:59:31 PDT 2026


================
@@ -473,6 +473,15 @@ def OffloadModuleInterface : OpInterface<"OffloadModuleInterface"> {
            return ::llvm::dyn_cast<BoolAttr>(isTargetDevice).getValue();
         return false;
       }]>,
+    InterfaceMethod<
+      /*description=*/[{
+        Return true if the current module was generated with OpenMP enabled.
+        }],
+      /*retTy=*/"bool",
+      /*methodName=*/"getIsOpenMP",
+      (ins), [{}], [{
+        return $_op->hasAttr("omp.is_target_device");
+      }]>,
----------------
skatrak wrote:

Yeah, adding a new attribute just for that doesn't make a lot of sense, but I think using `omp.version` as the indirect way of checking whether this is being compiled for OpenMP would be a good solution.

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


More information about the cfe-commits mailing list