[llvm] [mlir] [Utils][mlir] Fix interaction between CodeExtractor and OpenMPIRBuilder (PR #145051)

Kareem Ergawy via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 02:56:51 PDT 2025


================
@@ -2332,6 +2332,10 @@ mlir::translateModuleToLLVMIR(Operation *module, llvm::LLVMContext &llvmContext,
   // beforehand.
   translator.debugTranslation->addModuleFlagsIfNotPresent();
 
+  // Call the OpenMP IR Builder callbacks prior to verifying the module
+  if (auto *ompBuilder = translator.getOpenMPBuilder())
+    ompBuilder->finalize();
+
   if (!disableVerification &&
       llvm::verifyModule(*translator.llvmModule, &llvm::errs()))
     return nullptr;
----------------
ergawy wrote:

I think leaving it here makes more sense indeed. Thanks for looking into it.

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


More information about the llvm-commits mailing list