[GuardWidening] Ignore guards with trivial conditions
authorMax Kazantsev <max.kazantsev@azul.com>
Wed, 22 Aug 2018 02:40:49 +0000 (02:40 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Wed, 22 Aug 2018 02:40:49 +0000 (02:40 +0000)
commit611d645a08d154b46d9748bab73d5cc5180a6e68
tree9d93e4bfc2afdce540084d4f2d2aa37b6d80b59e
parent9ba5740ba56c23aedc05b70bf8028dd3cad82a83
[GuardWidening] Ignore guards with trivial conditions

Guard widening should not spend efforts on dealing with guards with trivial true/false conditions.
Such guards can easily be eliminated by any further cleanup pass like instcombine. However we
should not unconditionally delete them because it may be profitable to widen other conditions
into such guards.

Differential Revision: https://reviews.llvm.org/D50247
Reviewed By: fedor.sergeev

llvm-svn: 340381
llvm/lib/Transforms/Scalar/GuardWidening.cpp
llvm/test/Transforms/GuardWidening/basic.ll