[llvm-commits] [PATCH] ARM: Custom lower v2f32 = fp_round to fix crash with NEON

Pete Couperus pjcoup at gmail.com
Wed Nov 14 23:21:33 PST 2012


Hi Eli,

On Wed, Nov 14, 2012 at 10:13 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Wed, Nov 14, 2012 at 8:22 PM, Pete Couperus <pjcoup at gmail.com> wrote:
> > Hi Eli,
> >
> >
> > On Wed, Nov 14, 2012 at 5:58 PM, Eli Friedman <eli.friedman at gmail.com>
> > wrote:
> >>
> >> On Tue, Nov 13, 2012 at 11:24 PM, Pete Couperus <pjcoup at gmail.com>
> wrote:
> >> > Hello,
> >> >
> >> > Lowering "fptrunc <2 x double> %a to <2 x float>" is broken on ARM
> with
> >> > NEON.
> >> > This patch custom lowers this conversion using two single element
> >> > vcvt's.
> >> > This fixes the following PRs.
> >> >
> >> > http://llvm.org/bugs/show_bug.cgi?id=12540
> >> > http://llvm.org/bugs/show_bug.cgi?id=13964
> >> >
> >> > Please review!
> >> > Thanks.
> >>
> >> Does "setOperationAction(ISD::FP_ROUND, MVT::v2f32, Expand)" not do
> >> the right thing here?
> >>
> >> -Eli
> >
> >
> > No, setting FP_ROUND to expand for v2f32 gets an assert in a different
> > place:
> >
> > llc:
> /home/peter/llvm/llvm-svn/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:840:
> > void <anonymous
> > namespace>::SelectionDAGLegalize::LegalizeStoreOps(llvm::SDNode *):
> > Assertion `!StVT.isVector() && "Vector Stores are handled in
> > LegalizeVectorOps"' failed.
>
> That assertion means that VectorLegalizer::LegalizeOp is missing a
> case for FP_ROUND.
>
> -Eli
>

Ah, thanks.  So, the attached patch suffices?

Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121114/6389f34f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr12540.diff
Type: application/octet-stream
Size: 1607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121114/6389f34f/attachment.obj>


More information about the llvm-commits mailing list