[CorrelatedValuePropagation] Remove redundant if statement in processSelect()
authorEnna1 <xumingjie1995@outlook.com>
Sat, 28 Mar 2020 16:59:22 +0000 (17:59 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 28 Mar 2020 17:01:17 +0000 (18:01 +0100)
commit03bc311a16e292025f150ddafa9d468af562b897
tree8f10bf045e3507c48c8b0b62820244831933e760
parente6112a56dde6db13ea29721077cb9d294d01b54d
[CorrelatedValuePropagation] Remove redundant if statement in processSelect()

This statement

    if (ReplaceWith == S) ReplaceWith = UndefValue::get(S->getType());

is introduced in https://reviews.llvm.org/rG35609d97ae89b8e13f40f4e6b9b056954f8baa83
to fix a case where unreachable code can cause select instruction
simplification to fail. In https://reviews.llvm.org/rGd10480657527ffb44ea213460fb3676a6b1300aa,
we begin to perform a depth-first walk of basic blocks. This means
we will not visit unreachable blocks. So we do not need this the
special check any more.

Differential Revision: https://reviews.llvm.org/D76753
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp