Skip to content

Commit ad2fd11

Browse files
committed
Cranelift: Refactor legalization such that traversal is separate from legalizing a particular instruction
Notably, make sure that we aren't using the same `FuncCursor` for traversal and modification, as that makes it hard to follow when the traversal is being moved forward and backed up. Additionally, this makes it so that when we legalize an instruction, we only back up the cursor to continue legalization until we reach a fixed-point when said legalization resulted in something that actually requires further legalization. This should be mildly more efficient, since we can avoid an unnecessary loop iteration and its `match` on the just-legalized instruction data and opcode.
1 parent 7aea45a commit ad2fd11

File tree

1 file changed

+239
-185
lines changed
  • cranelift/codegen/src/legalizer

1 file changed

+239
-185
lines changed

0 commit comments

Comments
 (0)