aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2020-01-20 13:02:59 -0800
committerMircea Trofin <mtrofin@google.com>2020-01-20 13:03:15 -0800
commit2e42cc7a50e867d939cac6ee3d375a85a30b984d (patch)
tree46224898b89a983dd6c39b157584f64eaf3efc18 /llvm/lib/Analysis/InlineCost.cpp
parentb70e4efb75bf1670fa335f3211c05b26b060ffde (diff)
downloadllvm-2e42cc7a50e867d939cac6ee3d375a85a30b984d.zip
llvm-2e42cc7a50e867d939cac6ee3d375a85a30b984d.tar.gz
llvm-2e42cc7a50e867d939cac6ee3d375a85a30b984d.tar.bz2
[NFC] small rename of private member in InlineCost.cpp
Summary: Follow-up from https://reviews.llvm.org/D71733. Also moved an initialization to the base class, where it belonged in the first place. Reviewers: eraman, davidxl Reviewed By: davidxl Subscribers: hiraditya, haicheng, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72949
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index bc7d656..2f2d593 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -234,9 +234,7 @@ protected:
DenseMap<Value *, AllocaInst *> SROAArgValues;
/// Keep track of Allocas for which we believe we may get SROA optimization.
- /// We don't delete entries in SROAArgValue because we still want
- /// isAllocaDerivedArg to function correctly.
- DenseSet<AllocaInst *> EnabledSROAArgValues;
+ DenseSet<AllocaInst *> EnabledSROAAllocas;
/// Keep track of values which map to a pointer base and constant offset.
DenseMap<Value *, std::pair<Value *, APInt>> ConstantOffsetPtrs;
@@ -256,8 +254,7 @@ protected:
AllocaInst *getSROAArgForValueOrNull(Value *V) const {
auto It = SROAArgValues.find(V);
- if (It == SROAArgValues.end() ||
- EnabledSROAArgValues.count(It->second) == 0)
+ if (It == SROAArgValues.end() || EnabledSROAAllocas.count(It->second) == 0)
return nullptr;
return It->second;
}
@@ -513,7 +510,6 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
assert(Arg != nullptr &&
"Should not initialize SROA costs for null value.");
SROAArgCosts[Arg] = 0;
- EnabledSROAArgValues.insert(Arg);
}
void onAggregateSROAUse(AllocaInst *SROAArg) override {
@@ -651,7 +647,7 @@ bool CallAnalyzer::isAllocaDerivedArg(Value *V) {
void CallAnalyzer::disableSROAForArg(AllocaInst *SROAArg) {
onDisableSROA(SROAArg);
- EnabledSROAArgValues.erase(SROAArg);
+ EnabledSROAAllocas.erase(SROAArg);
disableLoadElimination();
}
/// If 'V' maps to a SROA candidate, disable SROA for it.
@@ -1941,6 +1937,7 @@ InlineResult CallAnalyzer::analyze() {
if (auto *SROAArg = dyn_cast<AllocaInst>(PtrArg)) {
SROAArgValues[&*FAI] = SROAArg;
onInitializeSROAArg(SROAArg);
+ EnabledSROAAllocas.insert(SROAArg);
}
}
}