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/CodeGen/AtomicExpandPass.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/CodeGen/AtomicExpandPass.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AtomicExpandPass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp index f7f9b1c..cea09bc 100644 --- a/llvm/lib/CodeGen/AtomicExpandPass.cpp +++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp @@ -208,7 +208,7 @@ bool AtomicExpandImpl::run(Function &F, const TargetMachine *TM) { if (!Subtarget->enableAtomicExpand()) return false; TLI = Subtarget->getTargetLowering(); - DL = &F.getParent()->getDataLayout(); + DL = &F.getDataLayout(); SmallVector<Instruction *, 1> AtomicInsts; @@ -1205,7 +1205,7 @@ Value *AtomicExpandImpl::insertRMWLLSCLoop( Function *F = BB->getParent(); assert(AddrAlign >= - F->getParent()->getDataLayout().getTypeStoreSize(ResultTy) && + F->getDataLayout().getTypeStoreSize(ResultTy) && "Expected at least natural alignment at this point."); // Given: atomicrmw some_op iN* %addr, iN %incr ordering |