[llvm] r237861 - [MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.
Ahmed Bougacha
ahmed.bougacha at gmail.com
Wed May 20 17:08:35 PDT 2015
Author: ab
Date: Wed May 20 19:08:35 2015
New Revision: 237861
URL: http://llvm.org/viewvc/llvm-project?rev=237861&view=rev
Log:
[MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.
We're erasing the instructions anyway.
Modified:
llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=237861&r1=237860&r2=237861&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Wed May 20 19:08:35 2015
@@ -874,7 +874,7 @@ bool MemCpyOpt::processMemSetMemCpyDepen
if (ConstantInt *SrcSizeC = dyn_cast<ConstantInt>(SrcSize))
Align = MinAlign(SrcSizeC->getZExtValue(), DestAlign);
- IRBuilder<> Builder(MemSet->getNextNode());
+ IRBuilder<> Builder(MemSet);
// If the sizes have different types, zext the smaller one.
if (DestSize->getType() != SrcSize->getType()) {
@@ -924,7 +924,7 @@ bool MemCpyOpt::performMemCpyToMemSetOpt
if (!MemSetSize || CopySize->getZExtValue() > MemSetSize->getZExtValue())
return false;
- IRBuilder<> Builder(MemCpy->getNextNode());
+ IRBuilder<> Builder(MemCpy);
Builder.CreateMemSet(MemCpy->getRawDest(), MemSet->getOperand(1),
CopySize, MemCpy->getAlignment());
return true;
More information about the llvm-commits
mailing list