You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collapse MovSX into Sext and MovZX into Zext in LIR
Summary:
`Sext`/`Zext` and `MovSX`/`MovZX` were two spellings of one operation. They
agree on every opcode property, `writesFlags`, `isEssential`,
`inputMustBeRegister`, `outputMustBeRegister` and `operandSizeType`, and both
already appear before and after register allocation, the LIR generator emits
`Sext`/`Zext`, while boxing, the compare widening in postgen and the divide
rewrite emit `MovSX`/`MovZX`. The only real difference was that
`rewriteBitExtensionInstrs` renamed the first pair into the second on its way to
codegen.
Keep `Sext`/`Zext` and drop `MovSX`/`MovZX`. Codegen grows the two opcodes it
used to reject, and `rewriteBitExtensionInstrs` shrinks to what it was really
for, turning the extensions that don't extend anything, a constant input or a
source at least as wide as the destination, into plain Moves. That pass now has
to return kUnchanged for a genuine extension, its stage runs to a fixpoint and
reporting a change it did not make would spin forever.
Marked a prototype: it builds and passes the runtime tests on x86-64,
but the aarch64 paths are compile-tested only.
Reviewed By: yoney
Differential Revision: D116068880
fbshipit-source-id: 386eb98ce7f79f8fcc7543fbc94b763599e777eb
0 commit comments