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 D104618
[LoopDeletion] Exploit undef Phi inputs when symbolically executing 1st iteration mkazantsev on Jun 20 2021, 11:43 PM. Authored by
Details Follow-up on Roman's idea expressed in D103959.
Diff Detail
Event TimelineComment Actions Urgh, I double-checked with lang ref and my initial version was fine: Branching on an undefined value is undefined behavior. Rolling back to initial version. Comment Actions Looks good to me, thank you. It is correct as per langref, but i'm not confident we currently Comment Actions Hi, Comment Actions I would suggest splitting this into two patches. The "ignore undef input in phi" is safe, and commonly done across the optimizer. The "branch on undef" is tricky. Just from a risk management perspective, I think it makes sense to split them into separate changes. If you want to split, you can consider this an LGTM for the "ignore undef input in phi" part, and then continue this review for the "branch on undef" part. |
nit: they are equal