[PATCH] D21468: Fixed LegacyPassManager inconsistency

Jesper Antonsson via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 17 06:18:58 PDT 2016


JesperAntonsson created this revision.
JesperAntonsson added reviewers: chandlerc, grosser.
JesperAntonsson added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.

This fix locks the "last use"-point for a pass as soon as the pass is determined to be "not preserved".

This prevents "last use" and "preservation" information from becoming inconsistent, i.e. a "last use" point beyond where the pass is no longer preserved. Since "last use" information is used to remove dead passes, this will make sure passes does not stay around when they are not preserved.

The LegacyPassManager has an algorithm that transitively calculates "last use", so a pass' last use point could otherwise be dragged along beyond non-preservation points, and thus stay alive for too long. For instance, two call graphs would exist at the same time, leading to various problems, especially value handle asserts.

This solves the following four llvm bugs:
26865 - Inliner crashes in ValueHandleBase::ValueIsDeleted
27050 - ArgumentPromotion crashing with "An asserting value handle still pointed to this value!"
27112 - Inliner crashing with "An asserting value handle still pointed to this value!"
27697 - Passmanager assertion failure in PassAnalysisSupport

http://reviews.llvm.org/D21468

Files:
  include/llvm/IR/LegacyPassManagers.h
  lib/IR/LegacyPassManager.cpp
  test/Feature/legacypassmanager.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21468.61084.patch
Type: text/x-patch
Size: 6188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160617/9aa36160/attachment.bin>


More information about the llvm-commits mailing list