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

Pete Couperus pjcoup at gmail.com
Thu Nov 15 21:36:31 PST 2012


Thanks Eli.

In the same way, FP_EXTEND can be marked as 'expand' for v2f64, and added
to the cases in LegalizeVectorOps.
I can submit this separately.

Pete

On Thu, Nov 15, 2012 at 12:01 AM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Wed, Nov 14, 2012 at 11:21 PM, Pete Couperus <pjcoup at gmail.com> wrote:
> > 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?
>
> Yes, LGTM.  (I'll commit it for you tomorrow if nobody else gets to it
> first.)
>
> -Eli
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121115/6c5cf736/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: neon_fpext.diff
Type: application/octet-stream
Size: 1524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121115/6c5cf736/attachment.obj>


More information about the llvm-commits mailing list