[cfe-dev] Integer factorizations in clang

Ivan Llopard ivanllopard at gmail.com
Thu Jan 5 07:18:10 PST 2012


Hello,

I have a small test case :

a = b * c + b * d

and clang is fatorizing b to get only one multiplication (-O3) which is 
normally good for most architectures. But in my case, that pattern takes 
just one instruction and I would like to recover it as is.
Where can I find this particular optimization in clang ?
Is there a way of setting multiplications as being cheaper than 
additions/subtracions in clang ?

Thanks in advance,

Ivan



More information about the cfe-dev mailing list