mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Erase all of the instructions that we RAUWed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184969 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1302,6 +1302,7 @@ void FuncSLP::optimizeGatherSequence() {
|
||||
// instructions. TODO: We can further optimize this scan if we split the
|
||||
// instructions into different buckets based on the insert lane.
|
||||
SmallPtrSet<Instruction*, 16> Visited;
|
||||
SmallPtrSet<Instruction*, 16> ToRemove;
|
||||
ReversePostOrderTraversal<Function*> RPOT(F);
|
||||
for (ReversePostOrderTraversal<Function*>::rpo_iterator I = RPOT.begin(),
|
||||
E = RPOT.end(); I != E; ++I) {
|
||||
@ -1319,6 +1320,7 @@ void FuncSLP::optimizeGatherSequence() {
|
||||
if (Insert->isIdenticalTo(*v) &&
|
||||
DT->dominates((*v)->getParent(), Insert->getParent())) {
|
||||
Insert->replaceAllUsesWith(*v);
|
||||
ToRemove.insert(Insert);
|
||||
Insert = 0;
|
||||
break;
|
||||
}
|
||||
@ -1327,6 +1329,13 @@ void FuncSLP::optimizeGatherSequence() {
|
||||
Visited.insert(Insert);
|
||||
}
|
||||
}
|
||||
|
||||
// Erase all of the instructions that we RAUWed.
|
||||
for (SmallPtrSet<Instruction*, 16>::iterator v = ToRemove.begin(),
|
||||
ve = ToRemove.end(); v != ve; ++v) {
|
||||
assert((*v)->getNumUses() == 0 && "Can't remove instructions with uses");
|
||||
(*v)->eraseFromParent();
|
||||
}
|
||||
}
|
||||
|
||||
/// The SLPVectorizer Pass.
|
||||
|
Reference in New Issue
Block a user