mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-10 06:03:52 +00:00
tryMergingIntoMemset can only handle constant length memsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d90a192279
commit
0468e3e265
@ -515,11 +515,12 @@ bool MemCpyOpt::processStore(StoreInst *SI, BasicBlock::iterator &BBI) {
|
|||||||
bool MemCpyOpt::processMemSet(MemSetInst *MSI, BasicBlock::iterator &BBI) {
|
bool MemCpyOpt::processMemSet(MemSetInst *MSI, BasicBlock::iterator &BBI) {
|
||||||
// See if there is another memset or store neighboring this memset which
|
// See if there is another memset or store neighboring this memset which
|
||||||
// allows us to widen out the memset to do a single larger store.
|
// allows us to widen out the memset to do a single larger store.
|
||||||
if (Instruction *I = tryMergingIntoMemset(MSI, MSI->getDest(),
|
if (isa<ConstantInt>(MSI->getLength()) && !MSI->isVolatile())
|
||||||
MSI->getValue())) {
|
if (Instruction *I = tryMergingIntoMemset(MSI, MSI->getDest(),
|
||||||
BBI = I; // Don't invalidate iterator.
|
MSI->getValue())) {
|
||||||
return true;
|
BBI = I; // Don't invalidate iterator.
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user