[PATCH] D61813: [globalisel] Fix iterator invalidation in the extload combines

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 16:56:41 PDT 2019


dsanders created this revision.
dsanders added a reviewer: aditya_nandakumar.
Herald added subscribers: Petar.Avramovic, volkan, javed.absar, kristof.beyls, rovka.
Herald added a project: LLVM.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D61813

Files:
  lib/CodeGen/GlobalISel/CombinerHelper.cpp
  test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-extending-loads.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61813.199109.patch
Type: text/x-patch
Size: 7593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190510/069bfd12/attachment.bin>


More information about the llvm-commits mailing list