[MemorySSAUpdater] Remove deleted trivial Phis from active workset
authorAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Mon, 16 Jul 2018 07:51:27 +0000 (07:51 +0000)
committerAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Mon, 16 Jul 2018 07:51:27 +0000 (07:51 +0000)
commitf854ce84c4cc676ff16adbe819db3bcfd325dabf
tree1e81ba2d3cd7311c35948627c326df601e60dedf
parent832f49b90a4907a0bc2b34b688c32f3c9613aab0
[MemorySSAUpdater] Remove deleted trivial Phis from active workset

Bug fix for PR37808. The regression test is a reduced version of the
original reproducer attached to the bug report. As stated in the report,
the problem was that InsertedPHIs was keeping dangling pointers to
deleted Memory-Phis. MemoryPhis are created eagerly and sometimes get
zapped shortly afterwards. I've used WeakVH instead of an expensive
removal operation from the active workset.

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

llvm-svn: 337149
llvm/include/llvm/Analysis/MemorySSAUpdater.h
llvm/lib/Analysis/MemorySSAUpdater.cpp
llvm/test/Transforms/GVNHoist/pr37808.ll [new file with mode: 0644]