OSDN Git Service

[Dominators] Visit affected node candidates found at different root levels
authorJakub Kuderski <kubakuderski@gmail.com>
Fri, 19 Jan 2018 21:27:24 +0000 (21:27 +0000)
committerJakub Kuderski <kubakuderski@gmail.com>
Fri, 19 Jan 2018 21:27:24 +0000 (21:27 +0000)
commitb552ffa8123d58972a4e32e532ef668c1d7088ba
tree6a6b0771eabf6e61c1f71e6fa300d27a255e4b43
parentfa14209a6c161de3687e192b62d64457a19fcfff
[Dominators] Visit affected node candidates found at different root levels

Summary:
This patch attempts to fix the DomTree incremental insertion bug found here [[ https://bugs.llvm.org/show_bug.cgi?id=35969 | PR35969 ]] .

When performing an insertion into a piece of unreachable CFG, we may find the same not at different levels. When this happens, the node can turn out to be affected when we find it starting from a node with a lower level in the tree. The level at which we start visitation affects if we consider a node affected or not.

This patch tracks the lowest level at which each node was visited during insertion and allows it to be visited multiple times, if it can cause it to be considered affected.

Reviewers: brzycki, davide, dberlin, grosser

Reviewed By: brzycki

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322993 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/GenericDomTreeConstruction.h
test/Transforms/JumpThreading/ddt-crash3.ll [new file with mode: 0644]
test/Transforms/JumpThreading/ddt-crash4.ll [new file with mode: 0644]
unittests/IR/DominatorTreeTest.cpp