[PATCH] [hexagon] remove sxth after max with two halfword operands
Sebastian Pop
spop at codeaurora.org
Mon Feb 4 11:01:53 PST 2013
Jyotsna Verma wrote:
> Please move them to the appropriate HexagonIntrinsics[V3/V4].td file.
> HexagonIntrinsicsOpt.td is not the right place for these patterns.
I think that what Ikhlas proposes is the right way to go:
In Hexagon.td you have
include "HexagonInstrInfo.td"
include "HexagonIntrinsics.td"
The patterns we are looking at are:
> > > +sextMinMaxIntrinsic<int_hexagon_A2_min, HEXAGON_A2_min>; def :
they use "int_hexagon_A2_min" defined in HexagonIntrinsics.td and
"HEXAGON_A2_min" defined in HexagonInstrInfo.td.
If you include these patterns in one of the HexagonInstrInfo*.td files, you
wouldn't have access to the intrinsic definition that follows by include order.
Sebastian
>
> Thanks,
> Jyotsna
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
> The Linux Foundation
>
>
> > -----Original Message-----
> > From: iajbar at codeaurora.org [mailto:iajbar at codeaurora.org]
> > Sent: Monday, February 04, 2013 11:47 AM
> > To: Jyotsna Verma
> > Cc: 'Ikhlas Ajbar'; llvm-commits at cs.uiuc.edu; adasgupt at codeaurora.org
> > Subject: RE: [PATCH] [hexagon] remove sxth after max with two halfword
> > operands
> >
> > I put these intrinsics in Hexagon.td because they take an intrinsic and an
> SD
> > node. Maybe I should move them to HexagonIntrinsicsOpt.td and include it
> > after the instruction and intrinsics td files.
> >
> > Thanks,
> > Ikhlas
> >
> >
> > > Also, is there a reason for defining these intrinsics in Hexagon.td
> > > instead of HexagonIntrinsics.td?
> > >
> > > +//===----------------------------------------------------------------
> > > +------
> > > ===//
> > > +// DAG to DAG optimizations: this section needs to be after including
> > > +// HexagonInstrInfo.td and HexagonIntrinsics.td.
> > > +//===----------------------------------------------------------------
> > > +------
> > > ===//
> > > +
> > > +class sextMinMaxIntrinsic<Intrinsic Op, InstHexagon Inst> :
> > > + Pat<(i32 (sext_inreg (i32 (Op (i32 PositiveHalfWord:$a),
> > > + (i32 PositiveHalfWord:$b))),
> > > + i16)),
> > > + (i32 (Inst (i32 IntRegs:$a), (i32 IntRegs:$b)))>;
> > > +
> > > +
> > > +def : sextMinMaxIntrinsic<int_hexagon_A2_max, HEXAGON_A2_max>;
> > def :
> > > +sextMinMaxIntrinsic<int_hexagon_A2_maxu, HEXAGON_A2_maxu>; def
> > :
> > > +sextMinMaxIntrinsic<int_hexagon_A2_min, HEXAGON_A2_min>; def :
> > > +sextMinMaxIntrinsic<int_hexagon_A2_minu, HEXAGON_A2_minu>;
> > >
> > > -Jyotsna
> > > --
> > > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> > > hosted by The Linux Foundation
> > >
> > >
> > >> -----Original Message-----
> > >> From: Ikhlas Ajbar [mailto:iajbar at codeaurora.org]
> > >> Sent: Tuesday, January 29, 2013 9:55 PM
> > >> To: llvm-commits at cs.uiuc.edu
> > >> Cc: iajbar at codeaurora.org; jverma at codeaurora.org;
> > >> adasgupt at codeaurora.org
> > >> Subject: [PATCH] [hexagon] remove sxth after max with two halfword
> > >> operands
> > >>
> > >> Hello,
> > >>
> > >> The attached patch improves the way min and max instructions are
> > >> generated to recognize more patterns. In particular, this patch was
> > >> needed to remove a sign extend halfword "sxth" after a max with two
> > >> halfword
> > >> operands: testcases attached.
> > >>
> > >> Tested on x86-linux with make check. Could you please review the patch?
> > >>
> > >> Thanks,
> > >> Ikhlas
> > >
> > >
> >
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
More information about the llvm-commits
mailing list