@@ -1404,13 +1404,13 @@ static bool hasUndefContents(MemorySSA *MSSA, BatchAAResults &AA, Value *V,
1404
1404
return false ;
1405
1405
}
1406
1406
1407
- static bool inputFullyCoveredBySrc (MemorySSA *MSSA, MemCpyInst *MemCpy,
1408
- MemIntrinsic *MemSrc, BatchAAResults &BAA) {
1409
- // If the memcpy is larger than the previous , but the memory was undef prior
1410
- // to that, we can just ignore the tail. Technically we're only
1411
- // interested in the bytes from 0..MemSrcOffset and
1412
- // MemSrcLength+MemSrcOffset..CopySize here, but as we can't easily represent
1413
- // this location, we use the full 0..CopySize range.
1407
+ // If the memcpy is larger than the previous, but the memory was undef prior to
1408
+ // that, we can just ignore the tail. Technically we're only interested in the
1409
+ // bytes from 0..MemSrcOffset and MemSrcLength+MemSrcOffset..CopySize here , but
1410
+ // as we can't easily represent this location (hasUndefContents uses mustAlias
1411
+ // which cannot deal with offsets), we use the full 0..CopySize range.
1412
+ static bool overreadUndefContents (MemorySSA *MSSA, MemCpyInst *MemCpy,
1413
+ MemIntrinsic *MemSrc, BatchAAResults &BAA) {
1414
1414
Value *CopySize = MemCpy->getLength ();
1415
1415
MemoryLocation MemCpyLoc = MemoryLocation::getForSource (MemCpy);
1416
1416
MemoryUseOrDef *MemSrcAccess = MSSA->getMemoryAccess (MemSrc);
@@ -1465,7 +1465,7 @@ bool MemCpyOptPass::performMemCpyToMemSetOptzn(MemCpyInst *MemCpy,
1465
1465
if (!CCopySize)
1466
1466
return false ;
1467
1467
if (CCopySize->getZExtValue () + MOffset > CMemSetSize->getZExtValue ()) {
1468
- if (!inputFullyCoveredBySrc (MSSA, MemCpy, MemSet, BAA))
1468
+ if (!overreadUndefContents (MSSA, MemCpy, MemSet, BAA))
1469
1469
return false ;
1470
1470
// Clip the memcpy to the bounds of the memset
1471
1471
if (MOffset == 0 )
0 commit comments