forked from OSchip/llvm-project
[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
This commit is contained in:
parent
b70e4efb75
commit
2e42cc7a50
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue