aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorVasileios Porpodas <vporpodas@google.com>2025-03-22 09:53:05 -0700
committerVasileios Porpodas <vporpodas@google.com>2025-03-22 10:13:39 -0700
commit973ea045aa89febc533cea165e78686e976b3805 (patch)
tree12b7d7f8a2a8acefab8ad5c44aa4de79d9799311 /llvm/lib/Analysis/InlineCost.cpp
parentdb7475a770c360a42560aa01859d5dcbb808ade8 (diff)
downloadllvm-973ea045aa89febc533cea165e78686e976b3805.zip
llvm-973ea045aa89febc533cea165e78686e976b3805.tar.gz
llvm-973ea045aa89febc533cea165e78686e976b3805.tar.bz2
Revert "[Analysis][EphemeralValuesAnalysis][NFCI] Remove EphemeralValuesCache class (#132454)"
This reverts commit 4adefcfb856aa304b7b0a9de1eec1814f3820e83.
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 76c3dd8..df212eb3 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -271,8 +271,7 @@ protected:
CallBase &CandidateCall;
/// Getter for the cache of ephemeral values.
- function_ref<EphemeralValuesAnalysis::Result &(Function &)>
- GetEphValuesCache = nullptr;
+ function_ref<EphemeralValuesCache &(Function &)> GetEphValuesCache = nullptr;
/// Extension points for handling callsite features.
// Called before a basic block was analyzed.
@@ -516,8 +515,8 @@ public:
function_ref<const TargetLibraryInfo &(Function &)> GetTLI = nullptr,
ProfileSummaryInfo *PSI = nullptr,
OptimizationRemarkEmitter *ORE = nullptr,
- function_ref<EphemeralValuesAnalysis::Result &(Function &)>
- GetEphValuesCache = nullptr)
+ function_ref<EphemeralValuesCache &(Function &)> GetEphValuesCache =
+ nullptr)
: TTI(TTI), GetAssumptionCache(GetAssumptionCache), GetBFI(GetBFI),
GetTLI(GetTLI), PSI(PSI), F(Callee), DL(F.getDataLayout()), ORE(ORE),
CandidateCall(Call), GetEphValuesCache(GetEphValuesCache) {}
@@ -1134,8 +1133,8 @@ public:
ProfileSummaryInfo *PSI = nullptr,
OptimizationRemarkEmitter *ORE = nullptr, bool BoostIndirect = true,
bool IgnoreThreshold = false,
- function_ref<EphemeralValuesAnalysis::Result &(Function &)>
- GetEphValuesCache = nullptr)
+ function_ref<EphemeralValuesCache &(Function &)> GetEphValuesCache =
+ nullptr)
: CallAnalyzer(Callee, Call, TTI, GetAssumptionCache, GetBFI, GetTLI, PSI,
ORE, GetEphValuesCache),
ComputeFullInlineCost(OptComputeFullInlineCost ||
@@ -2795,7 +2794,7 @@ InlineResult CallAnalyzer::analyze() {
SmallPtrSet<const Value *, 32> EphValuesStorage;
const SmallPtrSetImpl<const Value *> *EphValues = &EphValuesStorage;
if (GetEphValuesCache)
- EphValues = &GetEphValuesCache(F);
+ EphValues = &GetEphValuesCache(F).ephValues();
else
CodeMetrics::collectEphemeralValues(&F, &GetAssumptionCache(F),
EphValuesStorage);
@@ -2981,8 +2980,7 @@ InlineCost llvm::getInlineCost(
function_ref<const TargetLibraryInfo &(Function &)> GetTLI,
function_ref<BlockFrequencyInfo &(Function &)> GetBFI,
ProfileSummaryInfo *PSI, OptimizationRemarkEmitter *ORE,
- function_ref<EphemeralValuesAnalysis::Result &(Function &)>
- GetEphValuesCache) {
+ function_ref<EphemeralValuesCache &(Function &)> GetEphValuesCache) {
return getInlineCost(Call, Call.getCalledFunction(), Params, CalleeTTI,
GetAssumptionCache, GetTLI, GetBFI, PSI, ORE,
GetEphValuesCache);
@@ -3106,8 +3104,7 @@ InlineCost llvm::getInlineCost(
function_ref<const TargetLibraryInfo &(Function &)> GetTLI,
function_ref<BlockFrequencyInfo &(Function &)> GetBFI,
ProfileSummaryInfo *PSI, OptimizationRemarkEmitter *ORE,
- function_ref<EphemeralValuesAnalysis::Result &(Function &)>
- GetEphValuesCache) {
+ function_ref<EphemeralValuesCache &(Function &)> GetEphValuesCache) {
auto UserDecision =
llvm::getAttributeBasedInliningDecision(Call, Callee, CalleeTTI, GetTLI);