[Mlir-commits] [mlir] [mlir] Speed up FuncToLLVM: CallOpLowering using a hashtable (PR #68082)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue Oct 3 08:53:59 PDT 2023


================
@@ -765,6 +792,24 @@ struct ConvertFuncToLLVMPass
 
     const auto &dataLayoutAnalysis = getAnalysis<DataLayoutAnalysis>();
 
+    std::unordered_map<std::string, bool> hasBarePtrAttribute;
+    for (Region &region : m->getRegions()) {
+      for (Block &block : region.getBlocks()) {
+        for (Operation &op : block.getOperations()) {
+          if (isa<func::FuncOp>(op)) {
+            auto funcOp = cast<func::FuncOp>(op);
+            bool inserted = hasBarePtrAttribute
+                                .insert({funcOp.getSymName().str(),
+                                         funcOp->hasAttr(barePtrAttrName)})
----------------
ftynse wrote:

Can we just have a set of functions that do have the attribute instead of mapping to bool?

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


More information about the Mlir-commits mailing list