Open RKSimon opened 7 years ago
Current Codegen: https://godbolt.org/z/sHjPKH
Still not as good as it could be
I was expecting that it'd probably be done as part of commutation during TwoAddressInstructionPass/RegAlloc
Yes, good one, Simon. Delaying this until we hit the backend is a better choice.
I was expecting that it'd probably be done as part of commutation during TwoAddressInstructionPass/RegAlloc
Maybe a job for reassociate. I'm not sure this is always profitable in practice.
Extended Description
But we could avoid the extra mov by performing:
Which would be equivalent to:
Which annoyingly gets canonicalized to something very similar:
I'm assuming because add is more commutable.......