diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-01-26 21:31:35 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-01-26 21:31:35 +0000 |
| commit | 87256d8fe1e39128cdc31a88436c13cae5c6472b (patch) | |
| tree | 2ffe833f02453fe6379eed476c203a8964d80ff0 | |
| parent | 832e79ca3258067159b2c8764de3e1d01dfcdcaa (diff) | |
| download | bcm5719-llvm-87256d8fe1e39128cdc31a88436c13cae5c6472b.tar.gz bcm5719-llvm-87256d8fe1e39128cdc31a88436c13cae5c6472b.zip | |
Revert test polarity to match comment and desired outcome. Remove undeserved bonus.
A GEP with all constant indices is already considered free by
analyzeBasicBlock(), so don't give it an extra bonus in
CountCodeReductionForAlloca().
This patch should remove a small positive bias toward inlining functions with
variable-index GEPs, and remove a smaller negative bias from functions with
all-constant index GEPs.
llvm-svn: 94591
| -rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index ddf78a2ac0c..a5a0a98f5a1 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -87,8 +87,8 @@ unsigned InlineCostAnalyzer::FunctionInfo:: Reduction += 10; else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { // If the GEP has variable indices, we won't be able to do much with it. - if (!GEP->hasAllConstantIndices()) - Reduction += CountCodeReductionForAlloca(GEP)+15; + if (GEP->hasAllConstantIndices()) + Reduction += CountCodeReductionForAlloca(GEP); } else { // If there is some other strange instruction, we're not going to be able // to do much if we inline this. |

