This change should increase the chance that something like not(setcc) becomes setcc with an opposite cond.
This works by allowing truncation when calling isConstOrConstSplat and using the resulting ConstantSDNode's value type (instead of the SDNode's value type) to determine if the flip is possible or not in the extractBooleanFlip function.
Note that I'm unsure about this patch, so I'll need some feedback.
It looks fine to me, and it improves codegen in the ARM backend without affecting other backends, but I'm not sure this change is correct.
Is this a good place for this fix, or should this fix be done in the ARM backend instead?
// Before the patch vpnot // VPR = !VPR vpsel q0, q1, q2 // q0 = VPR ? q1 : q2 // After the patch vpsel q0, q2, q1 // q0 = VPR ? q2 : q1