[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Mar 12 10:33:07 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-llvm

Author: Tom Eccles (tblah)

<details>
<summary>Changes</summary>

It looks like the mappings for call instructions were forgotten here. This fixes a bug in OpenMP when in-lining a region containing call operations multiple times.

OpenMP array reductions 4/6

---
Full diff: https://github.com/llvm/llvm-project/pull/84955.diff


1 Files Affected:

- (modified) mlir/lib/Target/LLVMIR/ModuleTranslation.cpp (+2) 


``````````diff
diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index c00628a420a000..995544238e4a3c 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -716,6 +716,8 @@ void ModuleTranslation::forgetMapping(Region &region) {
           branchMapping.erase(&op);
         if (isa<LLVM::GlobalOp>(op))
           globalsMapping.erase(&op);
+        if (isa<LLVM::CallOp>(op))
+          callMapping.erase(&op);
         llvm::append_range(
             toProcess,
             llvm::map_range(op.getRegions(), [](Region &r) { return &r; }));

``````````

</details>


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


More information about the llvm-branch-commits mailing list