[PATCH] fix PR middle-end/22480
Uros Bizjak
ubizjak@gmail.com
Fri Sep 9 10:10:00 GMT 2005
On 9/7/05, Dorit Naishlos <DORIT@il.ibm.com> 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
suggested.
> 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
c++.
2005-09-09 Uros Bizjak <uros@kss-loka.si>
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.
* Makefile.in (tree-vect-transform.o): Depend on recog.h.
testsuite/ChangeLog:
2005-09-09 Uros Bizjak <uros@kss-loka.si>
PR middle-end/22480
* gcc.dg/vect/pr22480.c: New test.
Thanks for review,
Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr22480.diff
Type: application/octet-stream
Size: 2942 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050909/6a278f72/attachment.obj>
More information about the Gcc-patches
mailing list