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

Eli Friedman eli.friedman at gmail.com
Thu Nov 15 00:01:16 PST 2012


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



More information about the llvm-commits mailing list