mosa / MOSA-Project

Managed Operating System Alliance Project
https://www.mosa-project.org/
Other
406 stars 82 forks source link

Optimization: PHI Instruction Improvement #1142

Closed tgiphil closed 9 months ago

tgiphil commented 9 months ago

When exiting SSA form and removing the PHI instructions, rather than inserting a move instruction instead:

When the source move operand is only defined once, replace the defining instruction result operand with the move destination operand instead.

This will avoid useless move instructions and provide better form for the register allocator.

Example:

LoopTests::Loop0()