[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(),
----------------
ftynse wrote:

Let's not copy a string here...

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


More information about the Mlir-commits mailing list