@@ -1367,8 +1367,8 @@ bool MemCpyOptPass::processMemSetMemCpyDependence(MemCpyInst *MemCpy,
1367
1367
return true ;
1368
1368
}
1369
1369
1370
- // / Determine whether the pointer V had only undefined content from Def up to
1371
- // / the given Size, either because it was freshly alloca'd or started its
1370
+ // / Determine whether the pointer V had only undefined content (due to Def) up
1371
+ // / to the given Size, either because it was freshly alloca'd or started its
1372
1372
// / lifetime.
1373
1373
static bool hasUndefContents (MemorySSA *MSSA, BatchAAResults &AA, Value *V,
1374
1374
MemoryDef *Def, Value *Size) {
@@ -1404,8 +1404,8 @@ static bool hasUndefContents(MemorySSA *MSSA, BatchAAResults &AA, Value *V,
1404
1404
return false ;
1405
1405
}
1406
1406
1407
- static bool coversInputFully (MemorySSA *MSSA, MemCpyInst *MemCpy,
1408
- MemIntrinsic *MemSrc, BatchAAResults &BAA) {
1407
+ static bool inputFullyCoveredBySrc (MemorySSA *MSSA, MemCpyInst *MemCpy,
1408
+ MemIntrinsic *MemSrc, BatchAAResults &BAA) {
1409
1409
// If the memcpy is larger than the previous, but the memory was undef prior
1410
1410
// to that, we can just ignore the tail. Technically we're only
1411
1411
// interested in the bytes from 0..MemSrcOffset and
@@ -1452,7 +1452,6 @@ bool MemCpyOptPass::performMemCpyToMemSetOptzn(MemCpyInst *MemCpy,
1452
1452
MOffset = *Offset;
1453
1453
}
1454
1454
1455
- MaybeAlign MDestAlign = MemCpy->getDestAlign ();
1456
1455
if (MOffset != 0 || MemSetSize != CopySize) {
1457
1456
// Make sure the memcpy doesn't read any more than what the memset wrote,
1458
1457
// other than undef. Don't worry about sizes larger than i64. A known memset
@@ -1466,7 +1465,7 @@ bool MemCpyOptPass::performMemCpyToMemSetOptzn(MemCpyInst *MemCpy,
1466
1465
if (!CCopySize)
1467
1466
return false ;
1468
1467
if (CCopySize->getZExtValue () + MOffset > CMemSetSize->getZExtValue ()) {
1469
- if (!coversInputFully (MSSA, MemCpy, MemSet, BAA))
1468
+ if (!inputFullyCoveredBySrc (MSSA, MemCpy, MemSet, BAA))
1470
1469
return false ;
1471
1470
// Clip the memcpy to the bounds of the memset
1472
1471
if (MOffset == 0 )
0 commit comments