mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-29 08:16:51 +00:00
[MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.
We're erasing the instructions anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237861 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -874,7 +874,7 @@ bool MemCpyOpt::processMemSetMemCpyDependence(MemCpyInst *MemCpy,
|
|||||||
if (ConstantInt *SrcSizeC = dyn_cast<ConstantInt>(SrcSize))
|
if (ConstantInt *SrcSizeC = dyn_cast<ConstantInt>(SrcSize))
|
||||||
Align = MinAlign(SrcSizeC->getZExtValue(), DestAlign);
|
Align = MinAlign(SrcSizeC->getZExtValue(), DestAlign);
|
||||||
|
|
||||||
IRBuilder<> Builder(MemSet->getNextNode());
|
IRBuilder<> Builder(MemSet);
|
||||||
|
|
||||||
// If the sizes have different types, zext the smaller one.
|
// If the sizes have different types, zext the smaller one.
|
||||||
if (DestSize->getType() != SrcSize->getType()) {
|
if (DestSize->getType() != SrcSize->getType()) {
|
||||||
@@ -924,7 +924,7 @@ bool MemCpyOpt::performMemCpyToMemSetOptzn(MemCpyInst *MemCpy,
|
|||||||
if (!MemSetSize || CopySize->getZExtValue() > MemSetSize->getZExtValue())
|
if (!MemSetSize || CopySize->getZExtValue() > MemSetSize->getZExtValue())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
IRBuilder<> Builder(MemCpy->getNextNode());
|
IRBuilder<> Builder(MemCpy);
|
||||||
Builder.CreateMemSet(MemCpy->getRawDest(), MemSet->getOperand(1),
|
Builder.CreateMemSet(MemCpy->getRawDest(), MemSet->getOperand(1),
|
||||||
CopySize, MemCpy->getAlignment());
|
CopySize, MemCpy->getAlignment());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user