diff options
| author | Dehao Chen <dehao@google.com> | 2017-03-23 23:26:00 +0000 |
|---|---|---|
| committer | Dehao Chen <dehao@google.com> | 2017-03-23 23:26:00 +0000 |
| commit | 722e94061baa662a0f41ede6fd0cf6d0dcf5932a (patch) | |
| tree | e8de7b25f8207906b96af22fd15384142cde2639 /llvm/lib/Transforms | |
| parent | def79b21e4f45dec583beedf747c6a02c542164d (diff) | |
| download | bcm5719-llvm-722e94061baa662a0f41ede6fd0cf6d0dcf5932a.tar.gz bcm5719-llvm-722e94061baa662a0f41ede6fd0cf6d0dcf5932a.zip | |
Set the prof weight correctly for call instructions in DeadArgumentElimination.
Summary: In DeadArgumentElimination, the call instructions will be replaced. We also need to set the prof weights so that function inlining can find the correct profile.
Reviewers: eraman
Reviewed By: eraman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31143
llvm-svn: 298660
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp index 1f2216d37a1..fe79efce290 100644 --- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -194,6 +194,9 @@ bool DeadArgumentEliminationPass::DeleteDeadVarargs(Function &Fn) { cast<CallInst>(Call)->getTailCallKind()); } New->setDebugLoc(Call->getDebugLoc()); + uint64_t W; + if (Call->extractProfTotalWeight(W)) + New->setProfWeight(W); Args.clear(); @@ -901,6 +904,9 @@ bool DeadArgumentEliminationPass::RemoveDeadStuffFromFunction(Function *F) { cast<CallInst>(Call)->getTailCallKind()); } New->setDebugLoc(Call->getDebugLoc()); + uint64_t W; + if (Call->extractProfTotalWeight(W)) + New->setProfWeight(W); Args.clear(); |

