[PATCH] X86: fold SSE2/AVX2 logical shift by immediate amout into zero vector when possible

Andrea_DiBiagio at sn.scee.net Andrea_DiBiagio at sn.scee.net
Wed Jul 10 06:46:00 PDT 2013


Ping.

(See attached file: patch.diff)
Andrea DiBiagio/SN R&D/BS/UK/SCEE wrote on 01/07/2013 12:01:44:

> Friendly ping.
>
> > From: Andrea DiBiagio/SN R&D/BS/UK/SCEE
> > Hi all,
> >
> > I'd like to contribute a patch that teaches the x86 backend how to
> > combine SSE2/AVX2 packed logical shifts by immediate amount into
> > vectors of all 0s.
> >
> > SSE2/AVX2 logical shift by immediate amount where the amount is
> > greater than or
> > equal to the vector element size always return a vector of all 0s.
> >
> > Example:
> >  pslld $35, %xmm0   # SSE2 packed doubleword logical shift left.
> >                     # %xmm0 is a vector of packed int (MVT::v4i32).
> >
> > The shift from this example will return a vector of all zeros in %xmm0
and
> > therefore it could be easily rewritten for example as:
> >  xorps %xmm0, %xmm0
> >
> > This patch adds a new target combine rule in X86ISelLowering.cpp to
> > make sure that we simplify when possible vector shifts into zero
vectors.
> >
> > I added two new tests to verify that vector shifts are correctly folded
into
> > vectors of all 0s when the immediate amount is equal or exceeds
> > the vector element size.
> >
> > Thanks,
> > Andrea Di Biagio
> > SN Systems - Sony Computer Entertainment
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 14804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130710/b89ae264/attachment.obj>


More information about the llvm-commits mailing list