reassociation pass and built-in functions

Revital1 Eres ERES@il.ibm.com
Tue Feb 20 13:08:00 GMT 2007


Hello,

We saw that the reassociation pass does not operate on built-in functions,
for example:

vp3 = vec_madd (vp1, vp2, vp3);

In the RTL level the function is expanded to regular insn:

(insn 87 91 88 9 (set (reg/v:V4SF 217 [ vp3 ])
        (plus:V4SF (mult:V4SF (reg/v:V4SF 219 [ vp1 ])
                (reg/v:V4SF 218 [ vp2 ]))
            (reg/v:V4SF 217 [ vp3 ]))) -1 (nil)
    (nil))


The reassociation could open opportunity for the variable expansion
optimization to be applied when vec_madd is in a loop.
(this is what the reassociation pass do for similar accumulation
instruction that is not in built-in function)
Currently MVE fails as it expects the pattern:

x = x + something

while it finds:

x = something + x

I could fix this in the MVE code, but I was wondering about the
relations of reassociation pass and built-in functions in general.

Thanks,
Revital



More information about the Gcc mailing list