[PATCH] fix PR middle-end/22480

Uros Bizjak ubizjak@gmail.com
Sat Sep 10 11:00:00 GMT 2005


Richard Henderson wrote:

>>+	  optab_op2_mode = insn_data[icode].operand[2].mode;
>>+	  if (VECTOR_MODE_P (vec_mode)
>>+	      && !VECTOR_MODE_P (optab_op2_mode)
>>+	      && (dt == vect_constant_def
>>+		  || dt == vect_invariant_def))
>>    
>>
>I must be missing something.  At what point do you fail the transformation
>because op2 is *not* invariant?
>  
>
A couple of lines above, there is a loop that checks all tree operands 
with 'vect_is_simple_use (..., &dt)'. At the check quoted above, dt 
holds the definition of  the last operand, which is just what we need.

This optimization was suggested by Dorit in her earlier message:

>(by the way, vect_is_simple_use is already called earlier in that function,
>and the last value of 'dt' should hold the information you need).
>
Uros.



More information about the Gcc-patches mailing list