D-Programming-Language/dmd — pull request #2827 by yebblies (2013-11-19 16:33:44+00:00)
Title: Use short form of imul when src was in mAX anyway

The existing code generates silly stuff like
```
mov eax, dword ptr [ebp-8H] ; 0031 _ 8B. 45, F8
imul eax, dword ptr [ebp-0CH] ; 0034 _ 0F AF. 45, F4
```
Which should use the one-operand form of mul
```
mov eax, dword ptr [ebp-8H] ; 0031 _ 8B. 45, F8
imul dword ptr [ebp-0CH] ; 0034 _ F7. 6D, F4
```
This seems to be an attempt to avoid a useless mov if the result is not already in mAX, but we might as well use the short instruction form when we can.

In theory it could be done in the peephole optimizer, but matching all the instructions that could possibly produce a result in mAX does not look easy...