[llvm-commits] [llvm] r150060 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86InstrSSE.td

Duncan Sands baldrick at free.fr
Tue Feb 7 23:56:02 PST 2012


Hi Craig,

> I only removed the builtin lines. I didn't delete the intrinsics themselves.

if you are not planning to delete them, can you please put the builtin lines
back in again since dragonegg is using them.  Or would this cause problems
with clang, because that would cause it to go back to using the intrinsics?
If so, or you are planning to delete the intrinsics, I can always expand them
out to shuffles (or whatever) in dragonegg.

Ciao, Duncan.

PS: Removing the "builtin" lines also causes trouble for the C backend since
it uses them to output the intrinsics as builtinXYZ IIRC.  That said, no one
cares about the C backend any more.

>
> On Tue, Feb 7, 2012 at 11:30 PM, Duncan Sands <baldrick at free.fr
> <mailto:baldrick at free.fr>> wrote:
>
>     Hi Craig,
>
>      > Remove GCC builtins for vpermilp* intrinsics as clang no longer needs
>     them. Custom lower the intrinsics to the vpermilp target specific node and
>     remove intrinsic patterns.
>
>     what about auto-upgrade?
>
>     Ciao, Duncan.
>
>      >
>      > Modified:
>      >      llvm/trunk/include/llvm/IntrinsicsX86.td
>      >      llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>      >      llvm/trunk/lib/Target/X86/X86InstrSSE.td
>      >
>      > Modified: llvm/trunk/include/llvm/IntrinsicsX86.td
>      > URL:
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=150060&r1=150059&r2=150060&view=diff
>     <http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=150060&r1=150059&r2=150060&view=diff>
>      >
>     ==============================================================================
>      > --- llvm/trunk/include/llvm/IntrinsicsX86.td (original)
>      > +++ llvm/trunk/include/llvm/IntrinsicsX86.td Wed Feb  8 00:36:57 2012
>      > @@ -1092,17 +1092,17 @@
>      >           Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
>      >                     llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
>      >
>      > -  def int_x86_avx_vpermil_pd : GCCBuiltin<"__builtin_ia32_vpermilpd">,
>      > +  def int_x86_avx_vpermil_pd :
>      >           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
>      >                     llvm_i8_ty], [IntrNoMem]>;
>      > -  def int_x86_avx_vpermil_ps : GCCBuiltin<"__builtin_ia32_vpermilps">,
>      > +  def int_x86_avx_vpermil_ps :
>      >           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
>      >                     llvm_i8_ty], [IntrNoMem]>;
>      >
>      > -  def int_x86_avx_vpermil_pd_256 :
>     GCCBuiltin<"__builtin_ia32_vpermilpd256">,
>      > +  def int_x86_avx_vpermil_pd_256 :
>      >           Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
>      >                     llvm_i8_ty], [IntrNoMem]>;
>      > -  def int_x86_avx_vpermil_ps_256 :
>     GCCBuiltin<"__builtin_ia32_vpermilps256">,
>      > +  def int_x86_avx_vpermil_ps_256 :
>      >           Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
>      >                     llvm_i8_ty], [IntrNoMem]>;
>      >   }
>      >
>      > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>      > URL:
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=150060&r1=150059&r2=150060&view=diff
>     <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=150060&r1=150059&r2=150060&view=diff>
>      >
>     ==============================================================================
>      > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
>      > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Feb  8 00:36:57 2012
>      > @@ -9488,6 +9488,12 @@
>      >     case Intrinsic::x86_avx2_vperm2i128:
>      >       return DAG.getNode(X86ISD::VPERM2X128, dl, Op.getValueType(),
>      >                          Op.getOperand(1), Op.getOperand(2),
>     Op.getOperand(3));
>      > +  case Intrinsic::x86_avx_vpermil_ps:
>      > +  case Intrinsic::x86_avx_vpermil_pd:
>      > +  case Intrinsic::x86_avx_vpermil_ps_256:
>      > +  case Intrinsic::x86_avx_vpermil_pd_256:
>      > +    return DAG.getNode(X86ISD::VPERMILP, dl, Op.getValueType(),
>      > +                       Op.getOperand(1), Op.getOperand(2));
>      >
>      >     // ptest and testp intrinsics. The intrinsic these come from are
>     designed to
>      >     // return an integer value, not just an instruction so lower it to
>     the ptest
>      >
>      > Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td
>      > URL:
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=150060&r1=150059&r2=150060&view=diff
>     <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=150060&r1=150059&r2=150060&view=diff>
>      >
>     ==============================================================================
>      > --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)
>      > +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Wed Feb  8 00:36:57 2012
>      > @@ -7129,8 +7129,8 @@
>      >   //
>      >   multiclass avx_permil<bits<8>  opc_rm, bits<8>  opc_rmi, string OpcodeStr,
>      >                         RegisterClass RC, X86MemOperand x86memop_f,
>      > -                      X86MemOperand x86memop_i, PatFrag f_frag, PatFrag
>     i_frag,
>      > -                      Intrinsic IntVar, Intrinsic IntImm>  {
>      > +                      X86MemOperand x86memop_i, PatFrag i_frag,
>      > +                      Intrinsic IntVar, ValueType vt>  {
>      >     def rr  : AVX8I<opc_rm, MRMSrcReg, (outs RC:$dst),
>      >                (ins RC:$src1, RC:$src2),
>      >                !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1,
>     $src2}"),
>      > @@ -7144,63 +7144,40 @@
>      >     def ri  : AVXAIi8<opc_rmi, MRMSrcReg, (outs RC:$dst),
>      >                (ins RC:$src1, i8imm:$src2),
>      >                !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1,
>     $src2}"),
>      > -             [(set RC:$dst, (IntImm RC:$src1, imm:$src2))]>, VEX;
>      > +             [(set RC:$dst, (vt (X86VPermilp RC:$src1, (i8
>     imm:$src2))))]>, VEX;
>      >     def mi  : AVXAIi8<opc_rmi, MRMSrcMem, (outs RC:$dst),
>      >                (ins x86memop_f:$src1, i8imm:$src2),
>      >                !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst, $src1,
>     $src2}"),
>      > -             [(set RC:$dst, (IntImm (f_frag addr:$src1), imm:$src2))]>, VEX;
>      > +             [(set RC:$dst,
>      > +               (vt (X86VPermilp (memop addr:$src1), (i8 imm:$src2))))]>,
>     VEX;
>      >   }
>      >
>      >   let ExeDomain = SSEPackedSingle in {
>      >     defm VPERMILPS  : avx_permil<0x0C, 0x04, "vpermilps", VR128, f128mem,
>     i128mem,
>      > -                               memopv4f32, memopv2i64,
>      > -                               int_x86_avx_vpermilvar_ps,
>      > -                               int_x86_avx_vpermil_ps>;
>      > +                               memopv2i64, int_x86_avx_vpermilvar_ps,
>     v4f32>;
>      >     defm VPERMILPSY : avx_permil<0x0C, 0x04, "vpermilps", VR256, f256mem,
>     i256mem,
>      > -                               memopv8f32, memopv4i64,
>      > -                               int_x86_avx_vpermilvar_ps_256,
>      > -                               int_x86_avx_vpermil_ps_256>;
>      > +                              memopv4i64, int_x86_avx_vpermilvar_ps_256,
>     v8f32>;
>      >   }
>      >   let ExeDomain = SSEPackedDouble in {
>      >     defm VPERMILPD  : avx_permil<0x0D, 0x05, "vpermilpd", VR128, f128mem,
>     i128mem,
>      > -                               memopv2f64, memopv2i64,
>      > -                               int_x86_avx_vpermilvar_pd,
>      > -                               int_x86_avx_vpermil_pd>;
>      > +                               memopv2i64, int_x86_avx_vpermilvar_pd,
>     v2f64>;
>      >     defm VPERMILPDY : avx_permil<0x0D, 0x05, "vpermilpd", VR256, f256mem,
>     i256mem,
>      > -                               memopv4f64, memopv4i64,
>      > -                               int_x86_avx_vpermilvar_pd_256,
>      > -                               int_x86_avx_vpermil_pd_256>;
>      > +                              memopv4i64, int_x86_avx_vpermilvar_pd_256,
>     v4f64>;
>      >   }
>      >
>      >   let Predicates = [HasAVX] in {
>      > -def : Pat<(v8f32 (X86VPermilp VR256:$src1, (i8 imm:$imm))),
>      > -          (VPERMILPSYri VR256:$src1, imm:$imm)>;
>      > -def : Pat<(v4f64 (X86VPermilp VR256:$src1, (i8 imm:$imm))),
>      > -          (VPERMILPDYri VR256:$src1, imm:$imm)>;
>      >   def : Pat<(v8i32 (X86VPermilp VR256:$src1, (i8 imm:$imm))),
>      >             (VPERMILPSYri VR256:$src1, imm:$imm)>;
>      >   def : Pat<(v4i64 (X86VPermilp VR256:$src1, (i8 imm:$imm))),
>      >             (VPERMILPDYri VR256:$src1, imm:$imm)>;
>      > -def : Pat<(v8f32 (X86VPermilp (memopv8f32 addr:$src1), (i8 imm:$imm))),
>      > -          (VPERMILPSYmi addr:$src1, imm:$imm)>;
>      > -def : Pat<(v4f64 (X86VPermilp (memopv4f64 addr:$src1), (i8 imm:$imm))),
>      > -          (VPERMILPDYmi addr:$src1, imm:$imm)>;
>      >   def : Pat<(v8i32 (X86VPermilp (bc_v8i32 (memopv4i64 addr:$src1)),
>      >                                  (i8 imm:$imm))),
>      >             (VPERMILPSYmi addr:$src1, imm:$imm)>;
>      >   def : Pat<(v4i64 (X86VPermilp (memopv4i64 addr:$src1), (i8 imm:$imm))),
>      >             (VPERMILPDYmi addr:$src1, imm:$imm)>;
>      >
>      > -def : Pat<(v4f32 (X86VPermilp VR128:$src1, (i8 imm:$imm))),
>      > -          (VPERMILPSri VR128:$src1, imm:$imm)>;
>      > -def : Pat<(v2f64 (X86VPermilp VR128:$src1, (i8 imm:$imm))),
>      > -          (VPERMILPDri VR128:$src1, imm:$imm)>;
>      >   def : Pat<(v2i64 (X86VPermilp VR128:$src1, (i8 imm:$imm))),
>      >             (VPERMILPDri VR128:$src1, imm:$imm)>;
>      > -def : Pat<(v4f32 (X86VPermilp (memopv4f32 addr:$src1), (i8 imm:$imm))),
>      > -          (VPERMILPSmi addr:$src1, imm:$imm)>;
>      > -def : Pat<(v2f64 (X86VPermilp (memopv2f64 addr:$src1), (i8 imm:$imm))),
>      > -          (VPERMILPDmi addr:$src1, imm:$imm)>;
>      >   def : Pat<(v2i64 (X86VPermilp (memopv2i64 addr:$src1), (i8 imm:$imm))),
>      >             (VPERMILPDmi addr:$src1, imm:$imm)>;
>      >   }
>      >
>      >
>      > _______________________________________________
>      > llvm-commits mailing list
>      > llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>      > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>     _______________________________________________
>     llvm-commits mailing list
>     llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
>
> --
> ~Craig




More information about the llvm-commits mailing list