Affects Version/s: 2.9.0, 126.96.36.199, 2.9.1
Fix Version/s: None
Component/s: Compiler: Optimizing
Environment:IA32 optimizing compiler builds
Number of attachments :
Currently expression folding is performed on SSA. This is so that, for example:
x = y + c1
z = x + c2
z = y + (c1 +c2)
we know x won't have a different value other than the expression we're looking at. We can perform the same optimization locally (on a BB) if we track that the last assignment of x. This should mean we can cheaply run expression folding on low optimization levels.
This is important as we often see cases of:
whilst we convert foo into a "booleancmp_int x > 0" the subsequent ifcmp isn't folded. Expression folding would fold this example. Having reasonable expression folding would mean we could remove similar operations from BURS (these rules are often missing from PPC BURS to avoid having non-terminals).