[llvm] 596004a - MemCpyOptimizer.cpp - hasUndefContentsMSSA - Pass DataLayout by reference. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 8 02:42:07 PDT 2021
Author: Simon Pilgrim
Date: 2021-06-08T10:41:02+01:00
New Revision: 596004a94748e427ff59956e74d8ed4eb0e109d4
URL: https://github.com/llvm/llvm-project/commit/596004a94748e427ff59956e74d8ed4eb0e109d4
DIFF: https://github.com/llvm/llvm-project/commit/596004a94748e427ff59956e74d8ed4eb0e109d4.diff
LOG: MemCpyOptimizer.cpp - hasUndefContentsMSSA - Pass DataLayout by reference. NFCI.
Added:
Modified:
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 6cf317a1c47f7..db8d40b2bafaf 100644
--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -1275,7 +1275,7 @@ static bool hasUndefContentsMSSA(MemorySSA *MSSA, AliasAnalysis *AA, Value *V,
// The size also doesn't matter, as an out-of-bounds access would be UB.
AllocaInst *Alloca = dyn_cast<AllocaInst>(getUnderlyingObject(V));
if (getUnderlyingObject(II->getArgOperand(1)) == Alloca) {
- DataLayout DL = Alloca->getModule()->getDataLayout();
+ const DataLayout &DL = Alloca->getModule()->getDataLayout();
if (Optional<TypeSize> AllocaSize = Alloca->getAllocationSizeInBits(DL))
if (*AllocaSize == LTSize->getValue() * 8)
return true;
More information about the llvm-commits
mailing list