[all-commits] [llvm/llvm-project] fbbb68: [llvm-reduce] extractArgumentsFromModule(): don't ...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sat Jul 4 14:53:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fbbb6884e108419692a88e28eeeaa92cfbc08122
      https://github.com/llvm/llvm-project/commit/fbbb6884e108419692a88e28eeeaa92cfbc08122
  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-args-in-same-instruction.py
    A llvm/test/Reduce/remove-multiple-use-of-args-in-same-instruction.ll
    M llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp

  Log Message:
  -----------
  [llvm-reduce] extractArgumentsFromModule(): 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 arguments 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