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

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 09:07:48 PDT 2017


mehdi_amini added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:327
+  Cost += LoadEliminationCost;
+  LoadEliminationCostSavings = 0;
+  EnableLoadElimination = false;
----------------
haicheng wrote:
> mehdi_amini wrote:
> > It seems to me that it is `LoadEliminationCost` that needs to be set to 0 instead `LoadEliminationCostSavings`?
> When load elimination is disabled, LoadEliminationCostSavings needs to be set to 0 so that we can print the correct value.  LoadEliminationCost is not used any more after LoadElimination is disabled.
But calling multiple times disableLoadElimination will increase the Cost which does not seem right?


Repository:
  rL LLVM

https://reviews.llvm.org/D33946





More information about the llvm-commits mailing list