[PATCH] D23736: CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 20:06:07 PDT 2016


MatzeB added a comment.

I'll go ahead and push a first version after the LGTM, I'll be happy to address further issues in follow-up patches.


================
Comment at: include/llvm/CodeGen/MachineModuleInfo.h:193-194
@@ +192,4 @@
+  DenseMap<const Function*, std::unique_ptr<MachineFunction>> MachineFunctions;
+  const Function *LastRequest = nullptr; ///< Used for shortcut/cache.
+  MachineFunction *LastResult = nullptr; ///< Used for shortcut/cache.
+
----------------
MatzeB wrote:
> chandlerc wrote:
> > Is this really that hot? It seems a risky technique...
> To be honest I don't know, quite possibly not. I did not want to slow things down compared what we get today with the MachineFunctionAnalysis, anyway I'll run some tests and remove this if I can't measure a difference even in examples with lots of small functions.
With a testcase of 1000 functions that just return, valgrind/callgrind measures a difference of slightly more than 1% in the executed instructions.
This isn't that much considering it is an artificial testcase, on the other hand I believe this caching scheme to be extremely simple so I'd like to keep it.


Repository:
  rL LLVM

https://reviews.llvm.org/D23736





More information about the llvm-commits mailing list