[all-commits] [llvm/llvm-project] f804bd: [llvm-reduce] extractGVsFromModule(): don't crash ...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sat Jul 4 15:02:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f804bd586ee58199db4cfb2da8e9ef067425900b
      https://github.com/llvm/llvm-project/commit/f804bd586ee58199db4cfb2da8e9ef067425900b
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-07-05 (Sun, 05 Jul 2020)

  Changed paths:
    A llvm/test/Reduce/Inputs/remove-multiple-use-of-global-vars-in-same-instruction.py
    A llvm/test/Reduce/remove-multiple-use-of-global-vars-in-same-instruction.ll
    M llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp

  Log Message:
  -----------
  [llvm-reduce] extractGVsFromModule(): don't crash when deleting instr twice

As it can be seen in newly-added (previously-crashing) test-case,
there can be a situation where multiple GV's are used in instr,
and we would schedule the same instruction to be deleted several times,
crashing when trying to delete it the second time.

We could either store WeakVH (done here), or use something set-like.
I think using WeakVH is prevalent in these cases elsewhere.




More information about the All-commits mailing list