r600/sfn: Don't try to re-use the iterator when uses is updated
It seems on libc++ the iterator is invalidated when an element is removed from the set, so make sure that we don't implicitely use the old, invalidated iterator in the range based - open code the loop using while instead. Fixes: f3415c (r600/sfn: copy propagate register load chains) Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7931 Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20394>
This commit is contained in:
@@ -360,7 +360,12 @@ CopyPropFwdVisitor::visit(AluInstr *instr)
|
||||
auto src = instr->psrc(0);
|
||||
auto dest = instr->dest();
|
||||
|
||||
for (auto& i : dest->uses()) {
|
||||
auto ii = dest->uses().begin();
|
||||
auto ie = dest->uses().end();
|
||||
|
||||
while(ii != ie) {
|
||||
auto i = *ii;
|
||||
++ii;
|
||||
/* SSA can always be propagated, registers only in the same block
|
||||
* and only if they are assigned in the same block */
|
||||
bool can_propagate = dest->has_flag(Register::ssa);
|
||||
|
||||
Reference in New Issue
Block a user