[PATCH] D33946: [InlineCost] Find identical loads in the callee
Easwaran Raman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 9 06:14:54 PDT 2017
eraman added inline comments.
================
Comment at: lib/Analysis/InlineCost.cpp:836
+ // If the data are already loaded from this address and there is no store and
+ // call in the function, this load is likely to be redundant and can be
----------------
Nit: As written, IMO this is not very clear. I would be more specific - "... there is no reachable stores/calls or all reachable stores can be SROA'd..."
================
Comment at: lib/Analysis/InlineCost.cpp:935
bool CallAnalyzer::visitCallSite(CallSite CS) {
+ if (EnableLoadElimination)
+ disableLoadElimination();
----------------
If simplifyCallSite returns true below, disabling this is not needed. Even this is a bit conservative - I think you could call canConstantFoldCallTo directly and if it returns true do not disable load elimination.
Repository:
rL LLVM
https://reviews.llvm.org/D33946
More information about the llvm-commits
mailing list