You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be fun to look into before SSA arrives, but simplification + reassociation-to-canonicalize-commons is definitely one of those things you do once you have SSA. I will point out however that one of my favorite stupid optimizer tricks from years ago was to convert ((long long int) x << 32) into x * 0x100000000LL .
Surprisingly, this is not fixed by SSA. The reason is that the rule to convert *10 into *5 *2 with a LEAQ (x)(x*4) and a SHL $1,xtriggers before the rule to combine two constant multiplies.
Constant multiply combining does work for other non-LEAQable multiplies. For instance, *19*19.
compiles to:
Helping the compiler with a bit with associativity
generates better code:
This is more pronounced (and more complicated) with division:
generates:
Low priority.
The text was updated successfully, but these errors were encountered: