diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-28 08:36:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-28 08:36:49 +0200 |
commit | 9df71d7673b5c98e1032d01be83724a45b42fafc (patch) | |
tree | cf5f0c837110b4a753e71b0532d8e5ee6d487411 /llvm/lib/Analysis/InlineCost.cpp | |
parent | 519e0bb094bd9444b64ac62f2e8192543fdb94b9 (diff) | |
download | llvm-9df71d7673b5c98e1032d01be83724a45b42fafc.zip llvm-9df71d7673b5c98e1032d01be83724a45b42fafc.tar.gz llvm-9df71d7673b5c98e1032d01be83724a45b42fafc.tar.bz2 |
[IR] Add getDataLayout() helpers to Function and GlobalValue (#96919)
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds
`getDataLayout()` helpers to Function and GlobalValue, replacing the
current `getParent()->getDataLayout()` pattern.
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-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 f5b17dc..94aa8ec 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -498,7 +498,7 @@ public: ProfileSummaryInfo *PSI = nullptr, OptimizationRemarkEmitter *ORE = nullptr) : TTI(TTI), GetAssumptionCache(GetAssumptionCache), GetBFI(GetBFI), - PSI(PSI), F(Callee), DL(F.getParent()->getDataLayout()), ORE(ORE), + PSI(PSI), F(Callee), DL(F.getDataLayout()), ORE(ORE), CandidateCall(Call) {} InlineResult analyze(); @@ -2999,7 +2999,7 @@ std::optional<InlineResult> llvm::getAttributeBasedInliningDecision( // alloca, the inlined code would need to be adjusted to handle that the // argument is in the alloca address space (so it is a little bit complicated // to solve). - unsigned AllocaAS = Callee->getParent()->getDataLayout().getAllocaAddrSpace(); + unsigned AllocaAS = Callee->getDataLayout().getAllocaAddrSpace(); for (unsigned I = 0, E = Call.arg_size(); I != E; ++I) if (Call.isByValArgument(I)) { PointerType *PTy = cast<PointerType>(Call.getArgOperand(I)->getType()); |