| | 176 | == Instruction reordering == |
| | 177 | |
| | 178 | We should be able to reorder instructions in order to decrease register pressure. Here's an example from 3586.hs |
| | 179 | |
| | 180 | {{{ |
| | 181 | _cPY::I32 = I32[Sp - 24]; |
| | 182 | I32[R1 + 4] = _cPY::I32; |
| | 183 | I32[R1] = stg_IND_STATIC_info; |
| | 184 | I32[Sp - 8] = _cPY::I32; |
| | 185 | I32[Sp - 12] = stg_upd_frame_info; |
| | 186 | }}} |
| | 187 | |
| | 188 | R1 and Sp probably don't clobber each other, so we ought to use _cPY twice in quick succession. Fortunately stg_IND_STATIC_info is a constant so in this case the optimization doesn't help to much, but in other cases it might make sense. TODO Find better example |