OSDN Git Service

Use a WeakVH for UnknownInstructions in AliasSetTracker
authorSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 11 Mar 2017 01:15:48 +0000 (01:15 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 11 Mar 2017 01:15:48 +0000 (01:15 +0000)
commitc32a57361b89e8c5db1ac9ee291802088fe45c4c
tree06b5d9f68a2e5c66d4a99389dee0941e7b00951b
parent5b9a142f57f7f9bc1d0dbc8ef76241d4d06ed626
Use a WeakVH for UnknownInstructions in AliasSetTracker

Summary:
This change solves the same problem as D30726, except that this only
throws out the bathwater.

AST was not correctly tracking and deleting UnknownInstructions via
handles.  The existing code only tracks "pointers" in its
`ASTCallbackVH`, so an UnknownInstruction (that isn't also def'ing a
pointer used by another memory instruction) never gets a
`ASTCallbackVH`.

There are two other ways to solve this problem:

 - Use the `PointerRec` scheme for both known and unknown instructions.
 - Use a `CallbackVH` that erases the offending Instruction from the
   UnknownInstruction list.

Both of the above changes seemed to be significantly (and unnecessarily
IMO) more complex than this.

Reviewers: chandlerc, dberlin, hfinkel, reames

Subscribers: mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D30849

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297539 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/AliasSetTracker.h
lib/Analysis/AliasSetTracker.cpp
test/Transforms/LICM/pr32129.ll [new file with mode: 0644]