[llvm] [IR] Add getDataLayout() helpers to BasicBlock and Instruction (PR #96902)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 06:49:26 PDT 2024


================
@@ -459,7 +459,7 @@ class LoadEliminationForLoop {
 
     Type *LoadType = Initial->getType();
     Type *StoreType = Cand.Store->getValueOperand()->getType();
-    auto &DL = Cand.Load->getParent()->getModule()->getDataLayout();
+    auto &DL = Cand.Load->getParent()->getDataLayout();
----------------
dtcxzyw wrote:

```suggestion
    auto &DL = Cand.Load->getDataLayout();
```

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


More information about the llvm-commits mailing list