This is an archive of the discontinued LLVM Phabricator instance.

[globalisel] Fix iterator invalidation in the extload combines
ClosedPublic

Authored by dsanders on May 10 2019, 4:56 PM.

Details

Summary

Change the way we deal with iterator invalidation in the extload combines as it
was still possible to neglect to visit a use. Even worse, it happened in the
in-tree test cases and the checks weren't good enough to detect it.

We now take a cheap copy of the use list before iterating over it. This
prevents iterator invalidation from occurring and has the nice side effect
of making the existing schedule-for-erase/schedule-for-insert mechanism
moot.

Diff Detail

Repository
rL LLVM

Event Timeline

dsanders created this revision.May 10 2019, 4:56 PM

Looks reasonable.

This revision is now accepted and ready to land.May 10 2019, 5:44 PM
This revision was automatically updated to reflect the committed changes.