[LoopDeletion] Exploit undef Phi inputs when symbolically executing 1st iteration
authorMax Kazantsev <mkazantsev@azul.com>
Wed, 23 Jun 2021 04:51:36 +0000 (11:51 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Wed, 23 Jun 2021 04:53:48 +0000 (11:53 +0700)
commit842b4c83cb751d5f371ba27881fc92fdbd38d850
tree9ae108785e9467ecefcb7cbca5be90a8f7863e51
parentf681fd927e883301658dcac9a78109ee0aba12a8
[LoopDeletion] Exploit undef Phi inputs when symbolically executing 1st iteration

Follow-up on Roman's idea expressed in D103959.
- If a Phi has undefined inputs from live blocks:
   - and no other inputs, assume it is undef itself;
   - and exactly one non-undef input, we can assume that all undefs are equal to this input.

Differential Revision: https://reviews.llvm.org/D104618
Reviewed By: lebedev.ri, nikic
llvm/lib/Transforms/Scalar/LoopDeletion.cpp
llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll