Canonicalize and expressions involving widenable.conditions in two ways:
- Treat widenable.conditions are more complex (and thus placed on the LHS) as compared to other instructions
- Sink widenable.conditions to the outermost and in any and-tree.
- Remove redundant widenable.conditions within a single and-tree.
The net effect is that we merge two widenable branches (say via SimplifyCFG realizing they share a slowpath branch), we can canonicalize back to a simple widenable branch with some set of conditions and a single WC call.
Note that this needs to land after D70502 as it swaps the current right operand preference for the WC. The current choice is problematic as instcombine will happily swap operands such that e.g. an argument is on the right instead.
It's hard for me to match this comment to real code. Maybe just say "Swap OP1 & Op2 if Op2 is WC and Op1 is not" or "Canonicalize WC to LHS if RHS is not WC"?