[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:47 PDT 2024


================
@@ -15901,7 +15901,7 @@ bool AArch64TargetLowering::shouldSinkOperands(
         // the backend to generate a umull.
         unsigned Bitwidth = I->getType()->getScalarSizeInBits();
         APInt UpperMask = APInt::getHighBitsSet(Bitwidth, Bitwidth / 2);
-        const DataLayout &DL = I->getFunction()->getParent()->getDataLayout();
+        const DataLayout &DL = I->getFunction()->getDataLayout();
----------------
dtcxzyw wrote:

```suggestion
        const DataLayout &DL = I->getDataLayout();
```

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


More information about the llvm-commits mailing list