[InstCombine] Add frozen for the condition value of SelectInst
authorZhongyunde <zhongyunde@huawei.com>
Thu, 27 Apr 2023 13:32:28 +0000 (21:32 +0800)
committerZhongyunde <zhongyunde@huawei.com>
Thu, 27 Apr 2023 13:35:54 +0000 (21:35 +0800)
commit90d30fde12d80b633ce157b5f070a33e96018bbc
tree8a546560138953d472a265bd27558276c34bd3e1
parentf539b6ffc25144703498176558035c499825dc48
[InstCombine] Add frozen for the condition value of SelectInst

If the condition value of SelectInst may be a poison or undef value,
infer constant range at SelectInst use is incorrect, similar to D143883.
Fixes https://github.com/llvm/llvm-project/issues/62401

Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D149339
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/rem.ll
llvm/test/Transforms/InstCombine/shift.ll