Similar to the G_*MULO change.
The code for checking if a constant is legal/pre-legalize is shared between these, and is kind of hairy. So, factor it out into a new function: isConstantLegalOrBeforeLegalizer.
To make the refactoring clean, further refactor isLegalOrBeforeLegalizer into a wrapper for two functions:
- isPreLegalize
- isLegal
This is a bit easier to read in general.
I think there's use in distinguishing no-LegalizeInfo and being pre-legalize but I guess that's a different problem