We need to do E1-E2, but E1,E2 are arithmetic expressions themselves, so we need to evaluate them before we do the subtraction.
( ignoring load operation of the frst expressions)
What if we evaluate E1 first?
1. Evaluate E1 --> result ends up in register
2. Store E1 (since we also need to evaluate E2 using same reg.)
3. Load E2
4. Evaluate E2 ----> result in register
5. Store E2 ( since the operation requires the first operand to be in the register, we need to put E1 in register)
6. Load E1
7. SuB
now if we evaluate E2 first
1. Evaluate E2
2. Store E2
3. Load E1
4. Evaluate E1 ( First operand in register as intended)
5 Sub
When we evaluate E1 first, we need extra operation for storing E1, one extra load operation after the E2 is evaluated and stored.
So E2 evaluation should be done first.
" E1 and E2 do not have any common sub expression" - if they had common subexpressions, interleaved evaluation might have been an optimal choice(not necessarily by length of code), but we don't necessarily know the pattern of the common subexpression - so we can't really say anything about the length of code. Some codes might be smaller for interleaved evaluation, while others might be bigger.