[PATCH] D33946: [InlineCost] Find identical loads in the callee

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 20:14:57 PDT 2017


mehdi_amini added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:265
   unsigned SROACostSavingsLost;
+  unsigned CSELoadCostSavings;
 
----------------
haicheng wrote:
> mehdi_amini wrote:
> > chandlerc wrote:
> > > Similarly, I would call this `LoadCSECostSavings`.
> > Why do we have both `LoadEliminationCostSavings` and `LoadEliminationCost` ?
> `LoadEliminationCost` is used in the cost calculation, and  `LoadEliminationCostSavings` is used for stats printing.  This is the same as `SROACostSavings` and `SROAArgCosts`.
I'm still not making sense of the difference between the two: as far as I can tell they are zero-initialized in the same ctor and gets incremented the same way?


================
Comment at: lib/Analysis/InlineCost.cpp:327
+  Cost += LoadEliminationCost;
+  LoadEliminationCostSavings = 0;
+  EnableLoadElimination = false;
----------------
It seems to me that it is `LoadEliminationCost` that needs to be set to 0 instead `LoadEliminationCostSavings`?


Repository:
  rL LLVM

https://reviews.llvm.org/D33946





More information about the llvm-commits mailing list