# What is the name of this code transformation that uses associativity of addition?

I am learning about compiler optimization technique and there is a technique that use associativity of addition to transform code.

For example, consider the following expression:

(a + b) + ((c + d) + e)


It can be transformed into:

a + (b + (c + (d + e)))


Does anybody know the name of this transformation?

• Note that floating point addition is not associative. ​ ​ ​
– user12859
Oct 27, 2015 at 5:27
• Reordering maybe ? Oct 27, 2015 at 11:59
• Note that that "optimization" is actually a pessimization in this case - in the first example an out-of-order or pipelined CPU can issue [(a+b), (c+d)], then [(c+d)+e] then [(a + b) + ((c + d) + e)], taking 3 add latencies, whereas in the second case it takes 5 add latencies (as each add requires the previous one to be complete).
– TLW
Oct 27, 2015 at 19:47

-reassociate: Reassociate expressions
For example: 4 + (x + 5) ⇒ x + (4 + 5)