[Mlir-commits] [mlir] [MLIR][OpenMP] - Fix translation of omp.target when private variables need cleaning up (PR #129205)

Pranav Bhandarkar llvmlistbot at llvm.org
Fri Feb 28 00:19:14 PST 2025


https://github.com/bhandarkar-pranav created https://github.com/llvm/llvm-project/pull/129205

This is a simple fix that ensures that the InsertPoint is properly fixed up after we have translated the dealloc region of all privatized variables during translation of omp.target from MLIR to LLVMIR.

Fix for https://github.com/llvm/llvm-project/issues/129202

>From f7ec7560d72993c1bba7d1daac6bc8009b9056b3 Mon Sep 17 00:00:00 2001
From: Pranav Bhandarkar <pranav.bhandarkar at amd.com>
Date: Fri, 28 Feb 2025 01:10:53 -0600
Subject: [PATCH] [MLIR][OpenMP] - Fix translation of omp.target when private
 variables need cleaning up

This is a simple fix that ensures that the InsertPoint is properly fixed up
after we have translated the dealloc region of all privatized variables during
translation of omp.target from MLIR to LLVMIR.

Fix for https://github.com/llvm/llvm-project/issues/129202
---
 .../Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index 5035551dd6023..32c7c501d03c3 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -4832,6 +4832,7 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
             "failed to inline `dealloc` region of `omp.private` "
             "op in the target region");
       }
+      return builder.saveIP();
     }
 
     return InsertPointTy(exitBlock.get(), exitBlock.get()->end());



More information about the Mlir-commits mailing list