[clang] [mlir] [CIR][OpenMP] Add host op filtering pass to CIR pipeline (PR #209592)
Jan Leyonberg via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 16 06:23:33 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");
+ }]>,
----------------
jsjodin wrote:
Is there a reason to have this optional? I guess it would affect tests, but adding an extra attribute would do the same I thnk. This is an indirect way of checking if OpenMP is used so it looks a bit odd, although having two attributes is also not great since they can be inconsistent with each other if something goes wrong.
https://github.com/llvm/llvm-project/pull/209592
More information about the cfe-commits
mailing list