diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-12-23 06:40:39 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-12-23 06:40:39 +0000 |
commit | 5e4a03a08984d227c24de953ae158d7d551255c8 (patch) | |
tree | 174ec0117514f84cb5bbe393d95d5dfe2ce9e2de /llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | |
parent | 006bac688056e7d6b58708100bc4cc797ac12b23 (diff) | |
download | bcm5719-llvm-5e4a03a08984d227c24de953ae158d7d551255c8.tar.gz bcm5719-llvm-5e4a03a08984d227c24de953ae158d7d551255c8.zip |
[MemCpyOpt] Use LocationSize instead of ints; NFC
Trying to keep these patches super small so they're easily post-commit
verifiable, as requested in D44748.
srcSize is derived from the size of an alloca, and we quit out if the
size of that is > the size of the thing we're copying to. Hence, we
should always copy everything over, so these sizes are precise.
Don't make srcSize itself a LocationSize, since optionality isn't
helpful, and we do some comparisons against other sizes elsewhere in
that function.
llvm-svn: 350019
Diffstat (limited to 'llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 2dd961b0280..3315181c51d 100644 --- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -944,10 +944,10 @@ bool MemCpyOptPass::performCallSlotOptzn(Instruction *cpy, Value *cpyDest, // the use analysis, we also need to know that it does not sneakily // access dest. We rely on AA to figure this out for us. AliasAnalysis &AA = LookupAliasAnalysis(); - ModRefInfo MR = AA.getModRefInfo(C, cpyDest, srcSize); + ModRefInfo MR = AA.getModRefInfo(C, cpyDest, LocationSize::precise(srcSize)); // If necessary, perform additional analysis. if (isModOrRefSet(MR)) - MR = AA.callCapturesBefore(C, cpyDest, srcSize, &DT); + MR = AA.callCapturesBefore(C, cpyDest, LocationSize::precise(srcSize), &DT); if (isModOrRefSet(MR)) return false; @@ -1343,7 +1343,7 @@ bool MemCpyOptPass::processByValArgument(CallSite CS, unsigned ArgNo) { Type *ByValTy = cast<PointerType>(ByValArg->getType())->getElementType(); uint64_t ByValSize = DL.getTypeAllocSize(ByValTy); MemDepResult DepInfo = MD->getPointerDependencyFrom( - MemoryLocation(ByValArg, ByValSize), true, + MemoryLocation(ByValArg, LocationSize::precise(ByValSize)), true, CS.getInstruction()->getIterator(), CS.getInstruction()->getParent()); if (!DepInfo.isClobber()) return false; |