[PredicateInfo] Do not process unreachable operands.
authorTaewook Oh <twoh@fb.com>
Wed, 15 May 2019 19:35:38 +0000 (19:35 +0000)
committerTaewook Oh <twoh@fb.com>
Wed, 15 May 2019 19:35:38 +0000 (19:35 +0000)
commit9d020de3e867e17101299dcd278bacc1365dce25
tree89f005cf1f7bae148dd2af2080958a08771aa600
parente8a039d62c7e7c687d729bca5aacfc553125c0ea
[PredicateInfo] Do not process unreachable operands.

Summary: We should excluded unreachable operands from processing as their DFS visitation order is undefined. When `renameUses` function sorts `OpsToRename` (https://fburl.com/d2wubn60), the comparator assumes that the parent block of the operand has a corresponding dominator tree node. This is not the case for unreachable operands and crashes the compiler.

Reviewers: dberlin, mgrang, davide

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360796
llvm/lib/Transforms/Utils/PredicateInfo.cpp
llvm/test/Transforms/Util/PredicateInfo/unreachable.ll [new file with mode: 0644]