EVM has the EVMSingleUseExpression pass that performs code scheduling to reduce a number of required stack manipulation instructions. This pass work at the end of compilation pipeline, before the stackification transformation.
It makes sense to try to implement stack machine friendly code scheduling at in the ISel scheduler, as described in the article:
instruction_scheduling_for_stack_machines.pdf
EVM has the EVMSingleUseExpression pass that performs code scheduling to reduce a number of required stack manipulation instructions. This pass work at the end of compilation pipeline, before the stackification transformation. It makes sense to try to implement stack machine friendly code scheduling at in the ISel scheduler, as described in the article: instruction_scheduling_for_stack_machines.pdf