topperc wrote: I'm not sure I believe this belongs in the legalizer. This feels like custom instruction selection. I think its similar to the reasons AArch64 created AArch64PostLegalizerLowering. Perhaps we should be doing the same? https://github.com/llvm/llvm-project/pull/108859