I do intend to remove the intrinsics eventually. I just haven't looked at what I need to do in order to do that in the AutoUpgrade code so I didn't do it yet. The previous intrinsic removal was my first time using the IR builder functions so I'm pretty new to that side of llvm.<br>
<br>Would you prefer me to put the builtin lines back or would you rather fix dragonegg to not use them?<br><br>~Craig<br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 11:59 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Craig,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I suppose you need the same code that autoupgrade would if I removed the<br>
intrinsics in order to fix dragonegg?<br>
</blockquote>
<br></div>
yes, but I can also just copy clang's code.<br>
<br>
Ciao, Duncan.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
On Tue, Feb 7, 2012 at 11:44 PM, Craig Topper <<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a><u></u>>> wrote:<br>
<br>
I only removed the builtin lines. I didn't delete the intrinsics themselves.<br>
<br>
<br>
On Tue, Feb 7, 2012 at 11:30 PM, Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a><br></div><div><div class="h5">
<mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>>> wrote:<br>
<br>
Hi Craig,<br>
<br>
> Remove GCC builtins for vpermilp* intrinsics as clang no longer needs<br>
them. Custom lower the intrinsics to the vpermilp target specific node<br>
and remove intrinsic patterns.<br>
<br>
what about auto-upgrade?<br>
<br>
Ciao, Duncan.<br>
<br>
><br>
> Modified:<br>
> llvm/trunk/include/llvm/<u></u>IntrinsicsX86.td<br>
> llvm/trunk/lib/Target/X86/<u></u>X86ISelLowering.cpp<br>
> llvm/trunk/lib/Target/X86/<u></u>X86InstrSSE.td<br>
><br>
> Modified: llvm/trunk/include/llvm/<u></u>IntrinsicsX86.td<br>
> URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=150060&r1=150059&r2=150060&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/include/<u></u>llvm/IntrinsicsX86.td?rev=<u></u>150060&r1=150059&r2=150060&<u></u>view=diff</a><br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=150060&r1=150059&r2=150060&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/include/<u></u>llvm/IntrinsicsX86.td?rev=<u></u>150060&r1=150059&r2=150060&<u></u>view=diff</a>><br>
><br>
==============================<u></u>==============================<u></u>==================<br>
> --- llvm/trunk/include/llvm/<u></u>IntrinsicsX86.td (original)<br>
> +++ llvm/trunk/include/llvm/<u></u>IntrinsicsX86.td Wed Feb 8 00:36:57 2012<br>
> @@ -1092,17 +1092,17 @@<br>
> Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,<br>
> llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;<br>
><br>
> - def int_x86_avx_vpermil_pd : GCCBuiltin<"__builtin_ia32_<u></u>vpermilpd">,<br>
> + def int_x86_avx_vpermil_pd :<br>
> Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,<br>
> llvm_i8_ty], [IntrNoMem]>;<br>
> - def int_x86_avx_vpermil_ps : GCCBuiltin<"__builtin_ia32_<u></u>vpermilps">,<br>
> + def int_x86_avx_vpermil_ps :<br>
> Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,<br>
> llvm_i8_ty], [IntrNoMem]>;<br>
><br>
> - def int_x86_avx_vpermil_pd_256 :<br>
GCCBuiltin<"__builtin_ia32_<u></u>vpermilpd256">,<br>
> + def int_x86_avx_vpermil_pd_256 :<br>
> Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,<br>
> llvm_i8_ty], [IntrNoMem]>;<br>
> - def int_x86_avx_vpermil_ps_256 :<br>
GCCBuiltin<"__builtin_ia32_<u></u>vpermilps256">,<br>
> + def int_x86_avx_vpermil_ps_256 :<br>
> Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,<br>
> llvm_i8_ty], [IntrNoMem]>;<br>
> }<br>
><br>
> Modified: llvm/trunk/lib/Target/X86/<u></u>X86ISelLowering.cpp<br>
> URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=150060&r1=150059&r2=150060&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/Target/<u></u>X86/X86ISelLowering.cpp?rev=<u></u>150060&r1=150059&r2=150060&<u></u>view=diff</a><br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=150060&r1=150059&r2=150060&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/Target/<u></u>X86/X86ISelLowering.cpp?rev=<u></u>150060&r1=150059&r2=150060&<u></u>view=diff</a>><br>
><br>
==============================<u></u>==============================<u></u>==================<br>
> --- llvm/trunk/lib/Target/X86/<u></u>X86ISelLowering.cpp (original)<br>
> +++ llvm/trunk/lib/Target/X86/<u></u>X86ISelLowering.cpp Wed Feb 8 00:36:57<br>
2012<br>
> @@ -9488,6 +9488,12 @@<br>
> case Intrinsic::x86_avx2_<u></u>vperm2i128:<br>
> return DAG.getNode(X86ISD::<u></u>VPERM2X128, dl, Op.getValueType(),<br>
> Op.getOperand(1), Op.getOperand(2),<br>
Op.getOperand(3));<br>
> + case Intrinsic::x86_avx_vpermil_ps:<br>
> + case Intrinsic::x86_avx_vpermil_pd:<br>
> + case Intrinsic::x86_avx_vpermil_ps_<u></u>256:<br>
> + case Intrinsic::x86_avx_vpermil_pd_<u></u>256:<br>
> + return DAG.getNode(X86ISD::VPERMILP, dl, Op.getValueType(),<br>
> + Op.getOperand(1), Op.getOperand(2));<br>
><br>
> // ptest and testp intrinsics. The intrinsic these come from are<br>
designed to<br>
> // return an integer value, not just an instruction so lower it<br>
to the ptest<br>
><br>
> Modified: llvm/trunk/lib/Target/X86/<u></u>X86InstrSSE.td<br>
> URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=150060&r1=150059&r2=150060&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/Target/<u></u>X86/X86InstrSSE.td?rev=150060&<u></u>r1=150059&r2=150060&view=diff</a><br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=150060&r1=150059&r2=150060&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/Target/<u></u>X86/X86InstrSSE.td?rev=150060&<u></u>r1=150059&r2=150060&view=diff</a>><br>
><br>
==============================<u></u>==============================<u></u>==================<br>
> --- llvm/trunk/lib/Target/X86/<u></u>X86InstrSSE.td (original)<br>
> +++ llvm/trunk/lib/Target/X86/<u></u>X86InstrSSE.td Wed Feb 8 00:36:57 2012<br>
> @@ -7129,8 +7129,8 @@<br>
> //<br>
> multiclass avx_permil<bits<8> opc_rm, bits<8> opc_rmi, string<br>
OpcodeStr,<br>
> RegisterClass RC, X86MemOperand x86memop_f,<br>
> - X86MemOperand x86memop_i, PatFrag f_frag,<br>
PatFrag i_frag,<br>
> - Intrinsic IntVar, Intrinsic IntImm> {<br>
> + X86MemOperand x86memop_i, PatFrag i_frag,<br>
> + Intrinsic IntVar, ValueType vt> {<br>
> def rr : AVX8I<opc_rm, MRMSrcReg, (outs RC:$dst),<br>
> (ins RC:$src1, RC:$src2),<br>
> !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst,<br>
$src1, $src2}"),<br>
> @@ -7144,63 +7144,40 @@<br>
> def ri : AVXAIi8<opc_rmi, MRMSrcReg, (outs RC:$dst),<br>
> (ins RC:$src1, i8imm:$src2),<br>
> !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst,<br>
$src1, $src2}"),<br>
> - [(set RC:$dst, (IntImm RC:$src1, imm:$src2))]>, VEX;<br>
> + [(set RC:$dst, (vt (X86VPermilp RC:$src1, (i8<br>
imm:$src2))))]>, VEX;<br>
> def mi : AVXAIi8<opc_rmi, MRMSrcMem, (outs RC:$dst),<br>
> (ins x86memop_f:$src1, i8imm:$src2),<br>
> !strconcat(OpcodeStr, "\t{$src2, $src1, $dst|$dst,<br>
$src1, $src2}"),<br>
> - [(set RC:$dst, (IntImm (f_frag addr:$src1),<br>
imm:$src2))]>, VEX;<br>
> + [(set RC:$dst,<br>
> + (vt (X86VPermilp (memop addr:$src1), (i8<br>
imm:$src2))))]>, VEX;<br>
> }<br>
><br>
> let ExeDomain = SSEPackedSingle in {<br>
> defm VPERMILPS : avx_permil<0x0C, 0x04, "vpermilps", VR128,<br>
f128mem, i128mem,<br>
> - memopv4f32, memopv2i64,<br>
> - int_x86_avx_vpermilvar_ps,<br>
> - int_x86_avx_vpermil_ps>;<br>
> + memopv2i64,<br>
int_x86_avx_vpermilvar_ps, v4f32>;<br>
> defm VPERMILPSY : avx_permil<0x0C, 0x04, "vpermilps", VR256,<br>
f256mem, i256mem,<br>
> - memopv8f32, memopv4i64,<br>
> - int_x86_avx_vpermilvar_ps_256,<br>
> - int_x86_avx_vpermil_ps_256>;<br>
> + memopv4i64,<br>
int_x86_avx_vpermilvar_ps_256, v8f32>;<br>
> }<br>
> let ExeDomain = SSEPackedDouble in {<br>
> defm VPERMILPD : avx_permil<0x0D, 0x05, "vpermilpd", VR128,<br>
f128mem, i128mem,<br>
> - memopv2f64, memopv2i64,<br>
> - int_x86_avx_vpermilvar_pd,<br>
> - int_x86_avx_vpermil_pd>;<br>
> + memopv2i64,<br>
int_x86_avx_vpermilvar_pd, v2f64>;<br>
> defm VPERMILPDY : avx_permil<0x0D, 0x05, "vpermilpd", VR256,<br>
f256mem, i256mem,<br>
> - memopv4f64, memopv4i64,<br>
> - int_x86_avx_vpermilvar_pd_256,<br>
> - int_x86_avx_vpermil_pd_256>;<br>
> + memopv4i64,<br>
int_x86_avx_vpermilvar_pd_256, v4f64>;<br>
> }<br>
><br>
> let Predicates = [HasAVX] in {<br>
> -def : Pat<(v8f32 (X86VPermilp VR256:$src1, (i8 imm:$imm))),<br>
> - (VPERMILPSYri VR256:$src1, imm:$imm)>;<br>
> -def : Pat<(v4f64 (X86VPermilp VR256:$src1, (i8 imm:$imm))),<br>
> - (VPERMILPDYri VR256:$src1, imm:$imm)>;<br>
> def : Pat<(v8i32 (X86VPermilp VR256:$src1, (i8 imm:$imm))),<br>
> (VPERMILPSYri VR256:$src1, imm:$imm)>;<br>
> def : Pat<(v4i64 (X86VPermilp VR256:$src1, (i8 imm:$imm))),<br>
> (VPERMILPDYri VR256:$src1, imm:$imm)>;<br>
> -def : Pat<(v8f32 (X86VPermilp (memopv8f32 addr:$src1), (i8 imm:$imm))),<br>
> - (VPERMILPSYmi addr:$src1, imm:$imm)>;<br>
> -def : Pat<(v4f64 (X86VPermilp (memopv4f64 addr:$src1), (i8 imm:$imm))),<br>
> - (VPERMILPDYmi addr:$src1, imm:$imm)>;<br>
> def : Pat<(v8i32 (X86VPermilp (bc_v8i32 (memopv4i64 addr:$src1)),<br>
> (i8 imm:$imm))),<br>
> (VPERMILPSYmi addr:$src1, imm:$imm)>;<br>
> def : Pat<(v4i64 (X86VPermilp (memopv4i64 addr:$src1), (i8 imm:$imm))),<br>
> (VPERMILPDYmi addr:$src1, imm:$imm)>;<br>
><br>
> -def : Pat<(v4f32 (X86VPermilp VR128:$src1, (i8 imm:$imm))),<br>
> - (VPERMILPSri VR128:$src1, imm:$imm)>;<br>
> -def : Pat<(v2f64 (X86VPermilp VR128:$src1, (i8 imm:$imm))),<br>
> - (VPERMILPDri VR128:$src1, imm:$imm)>;<br>
> def : Pat<(v2i64 (X86VPermilp VR128:$src1, (i8 imm:$imm))),<br>
> (VPERMILPDri VR128:$src1, imm:$imm)>;<br>
> -def : Pat<(v4f32 (X86VPermilp (memopv4f32 addr:$src1), (i8 imm:$imm))),<br>
> - (VPERMILPSmi addr:$src1, imm:$imm)>;<br>
> -def : Pat<(v2f64 (X86VPermilp (memopv2f64 addr:$src1), (i8 imm:$imm))),<br>
> - (VPERMILPDmi addr:$src1, imm:$imm)>;<br>
> def : Pat<(v2i64 (X86VPermilp (memopv2i64 addr:$src1), (i8 imm:$imm))),<br>
> (VPERMILPDmi addr:$src1, imm:$imm)>;<br>
> }<br>
><br>
><br>
> ______________________________<u></u>_________________<br>
> llvm-commits mailing list<br></div></div>
> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a> <mailto:<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.<u></u>edu</a>><div class="im">
<br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br></div>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a> <mailto:<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.<u></u>edu</a>><div class="im"><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
<br>
<br>
<br>
--<br>
~Craig<br>
<br>
<br>
<br>
<br>
--<br>
~Craig<br>
</div></blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>~Craig<br>