[Mlir-commits] [clang] [mlir] [CIR][OpenMP] Add host op filtering pass to CIR pipeline (PR #209592)
Sergio Afonso
llvmlistbot at llvm.org
Mon Jul 20 02:58:38 PDT 2026
================
@@ -5130,22 +5130,25 @@ std::unique_ptr<mlir::Pass> createConvertCIRToLLVMPass() {
return std::make_unique<ConvertCIRToLLVMPass>();
}
-void populateCIRToLLVMPasses(mlir::OpPassManager &pm) {
+void populateCIRToLLVMPasses(mlir::OpPassManager &pm, bool enableOpenMP) {
mlir::populateCIRPreLoweringPasses(pm);
- pm.addPass(mlir::omp::createMarkDeclareTargetPass());
+ if (enableOpenMP)
+ pm.addPass(mlir::omp::createMarkDeclareTargetPass());
pm.addPass(createConvertCIRToLLVMPass());
+ if (enableOpenMP)
+ pm.addPass(mlir::omp::createHostOpFilteringPass());
}
std::unique_ptr<llvm::Module>
lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp mlirModule, LLVMContext &llvmCtx,
----------------
skatrak wrote:
Nit: The `enableOpenMP` flag is obtained from the already present `mlirModule`. I'd suggest removing the new function argument, but it's not a blocker for me.
https://github.com/llvm/llvm-project/pull/209592
More information about the Mlir-commits
mailing list