Skip to content
Commit 4cdb91f9 authored by Nikita Popov's avatar Nikita Popov
Browse files

[SCEV] Clarify inference in isAddRecNeverPoison()

The justification in isAddRecNeverPoison() no longer applies, as
it dates back to a time where LLVM had an unconditional forward
progress guarantee. However, we also no longer need it, because we
can exploit branch on poison UB instead.

For a single exit loop (without abnormal exits) we know that all
instructions dominating the exit will be executed, so if any of
them trigger UB on poison that means that addrec is not poison.

This is slightly stronger than the previous code, because a) we
don't need the exit to also be the latch and b) we don't need the
value to be used in the exit branch in particular, any UB-producing
instruction is fine.

I don't expect much practical impact from this change, this is
mainly to clarify the reasoning behind this logic.

Differential Revision: https://reviews.llvm.org/D148633
parent 1a58c3d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment