This is an alternative to D67614. Instead of lowering i1 inserts through a SIGN_EXTEND_INREG and a BFI, we can go via a SHL and a SRA (and the BFI). This, instead of being optimised to a rsb ubfx pair, will become a sbfx as desired.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
If SelectionDAGLegalize::ExpandNode is expanding SIGN_EXTEND_INREG of i1 to a non-canonical form, maybe it makes more sense to fix that, instead of trying to avoid that codepath? I mean, this is fine, given we know it's going to get expanded anyway. But the same problem might come up again later out of target-independent code generating an i1 SIGN_EXTEND_INREG.
But we can merge this now and deal with that later, if you want.
Comment Actions
Good question :) I think it improved some codegen in places we hope never actually comes up in practice.
This will at least need a rebase to see if it's still relevant.