Teach getGuaranteedNonPoisonOps() and thus programUndefinedIfPoison() that branching on poison is undefined behavior.
LangRef for br and switch:
If ‘cond’ is poison or undef, this instruction has undefined behavior.
If ‘value’ is poison or undef, this instruction has undefined behavior.
The primary effects of this change are:
- Strengthen transferal of nowrap flags from IR to SCEV (now works for non-latch branches)
- Strengthen isGuaranteedNotToBeUndefOrPoison, see e.g. the (Aggressive)InstCombine changes
- Strengthen noundef deduction in Attributor.