[llvm-branch-commits] [clang] [llvm] [mlir] [MLIR][OpenMP] Add LLVM translation support for OpenMP UserDefinedMappers (PR #124746)

Kareem Ergawy via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jan 31 01:39:06 PST 2025


================
@@ -3421,6 +3441,85 @@ static void genMapInfos(llvm::IRBuilderBase &builder,
   }
 }
 
+static llvm::Expected<llvm::Function *>
+emitUserDefinedMapper(Operation *declMapperOp, llvm::IRBuilderBase &builder,
+                      LLVM::ModuleTranslation &moduleTranslation);
+
+static llvm::Expected<llvm::Function *>
+getOrCreateUserDefinedMapperFunc(Operation *declMapperOp,
+                                 llvm::IRBuilderBase &builder,
+                                 LLVM::ModuleTranslation &moduleTranslation) {
+  llvm::DenseMap<const Operation *, llvm::Function *> userDefMapperMap;
+  auto iter = userDefMapperMap.find(declMapperOp);
----------------
ergawy wrote:

Yes, that's my point, you get a new instance of `userDefMapperMap` with every invocation of `getOrCreateUserDefinedMapperFunc` and you directly search it for the user defined maper of `declMapperOp`. So nothing is actually cache. Did I miss something?

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


More information about the llvm-branch-commits mailing list