]> granicus.if.org Git - llvm/commit
[PM] Replace the hard invalidate in JumpThreading for LVI with correct
authorChandler Carruth <chandlerc@gmail.com>
Mon, 23 Jan 2017 08:33:24 +0000 (08:33 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 23 Jan 2017 08:33:24 +0000 (08:33 +0000)
commit7576d48d1f4a3612c401bfc6874834a483a2df4b
tree027d3127a4565dbb80468f1e5d67bb390836603c
parent4717ef2100d5d4309215a929be53b7c052f05ef4
[PM] Replace the hard invalidate in JumpThreading for LVI with correct
invalidation of deleted functions in GlobalDCE.

This was always testing a bug really triggered in GlobalDCE. Right now
we have analyses with asserting value handles into IR. As long as those
remain, when *deleting* an IR unit, we cannot wait for the normal
invalidation scheme to kick in even though it was designed to work
correctly in the face of these kinds of deletions. Instead, the pass
needs to directly handle invalidating the analysis results pointing at
that IR unit.

I've tought the Inliner about this and this patch teaches GlobalDCE.
This will handle the asserting VH case in the existing test as well as
other issues of the same fundamental variety. I've moved the test into
the GlobalDCE directory and added a comment explaining what is going on.

Note that we cannot simply require LVI here because LVI is too lazy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292773 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/Scalar/JumpThreading.cpp
test/Other/new-pm-defaults.ll
test/Transforms/GlobalDCE/crash-assertingvh.ll [moved from test/Transforms/JumpThreading/crash-assertingvh.ll with 64% similarity]