[llvm] [IR] Add getDataLayout() helpers to Function and GlobalValue (PR #96919)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 08:56:50 PDT 2024


================
@@ -1815,7 +1815,7 @@ bool MemCpyOptPass::processMemMove(MemMoveInst *M) {
 
 /// This is called on every byval argument in call sites.
 bool MemCpyOptPass::processByValArgument(CallBase &CB, unsigned ArgNo) {
-  const DataLayout &DL = CB.getCaller()->getParent()->getDataLayout();
+  const DataLayout &DL = CB.getCaller()->getDataLayout();
----------------
dtcxzyw wrote:

```suggestion
  const DataLayout &DL = CB.getDataLayout();
```

https://github.com/llvm/llvm-project/pull/96919


More information about the llvm-commits mailing list