This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix PR middle-end/22480

On 9/7/05, Dorit Naishlos <> wrote:

> Don't you want to make sure that op1 is actually constant/invariant?
> You can do that calling
> 'vect_is_simple_use (op1, loop_vinfo, &def_stmt1, &def1, &dt1);'
> and you want to check that
> dt1 == vect_invariant_def || dt1 == vect_invariant_def.
> (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).

I was under impression that vect_is_simple use implies check for only
constants and loop invariants. Anyway, I have added the check you

> Also, do we really want to allow this for any vector operation, or only for
> vector shifts? (are there any other vector operations that behave like
> this?)

I was thinking about multiplicaton (or integer division) of a vector
value by a vector of equal 2^N constant elements. This operation can
be simplified to a vector shift, but IMHO this tranformation should be
done elsewhere.

Attached to this message, please find updated patch that addresses all
your suggestions. Patch was regtested on i686-pc-linux-gnu for c and

2005-09-09  Uros Bizjak  <>

	PR middle-end/22480

	* tree-vect-transform.c (vectorizable_operation): Use scalar
	tree operand op1 as shift operand when shift insn pattern uses
	scalar shift operand.
	* (tree-vect-transform.o): Depend on recog.h.


2005-09-09  Uros Bizjak  <>

	PR middle-end/22480
	* gcc.dg/vect/pr22480.c: New test.

Thanks for review,

Attachment: pr22480.diff
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]