mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
R600: Fix a potential iterator invalidation issue.
As a bonus this reduces the loop from O(n^2) to O(n). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183532 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
74f03455e5
commit
47b0c0a9a0
@ -198,11 +198,9 @@ MachineInstr *R600VectorRegMerger::RebuildVector(
|
|||||||
.addReg(SubReg)
|
.addReg(SubReg)
|
||||||
.addImm(Chan);
|
.addImm(Chan);
|
||||||
UpdatedRegToChan[SubReg] = Chan;
|
UpdatedRegToChan[SubReg] = Chan;
|
||||||
for (std::vector<unsigned>::iterator RemoveIt = UpdatedUndef.begin(),
|
UpdatedUndef.erase(
|
||||||
RemoveE = UpdatedUndef.end(); RemoveIt != RemoveE; ++ RemoveIt) {
|
std::remove(UpdatedUndef.begin(), UpdatedUndef.end(), Chan),
|
||||||
if (*RemoveIt == Chan)
|
UpdatedUndef.end());
|
||||||
UpdatedUndef.erase(RemoveIt);
|
|
||||||
}
|
|
||||||
DEBUG(dbgs() << " ->"; Tmp->dump(););
|
DEBUG(dbgs() << " ->"; Tmp->dump(););
|
||||||
(void)Tmp;
|
(void)Tmp;
|
||||||
SrcVec = DstReg;
|
SrcVec = DstReg;
|
||||||
|
Loading…
Reference in New Issue
Block a user