[all-commits] [llvm/llvm-project] 37b96d: CodeGenPrep: remove AssertingVH references before ...

Tim Northover via All-commits all-commits at lists.llvm.org
Wed Jul 15 07:19:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 37b96d51d0cfc82a64598aaae2a567fa77e44de9
      https://github.com/llvm/llvm-project/commit/37b96d51d0cfc82a64598aaae2a567fa77e44de9
  Author: Tim Northover <t.p.northover at gmail.com>
  Date:   2020-07-15 (Wed, 15 Jul 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/Local.h
    M llvm/lib/CodeGen/CodeGenPrepare.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    A llvm/test/Transforms/CodeGenPrepare/ARM/dead-gep.ll

  Log Message:
  -----------
  CodeGenPrep: remove AssertingVH references before deleting dead instructions.

CodeGenPrepare keeps fairly close track of various instructions it's
seen, particularly GEPs, in maps and vectors. However, sometimes those
instructions become dead and get removed while it's still executing.
This triggers AssertingVH references to them in an asserts build and
could lead to miscompiles in a release build (I've only seen a later
segfault though).

So this patch adds a callback to
RecursivelyDeleteTriviallyDeadInstructions which can make sure the
instruction about to be deleted is removed from CodeGenPrepare's data
structures.




More information about the All-commits mailing list