Looks like they aren't in 3.0 so we should be good.<br><br>Can the earlier intrinsics upgrades I did in AutoUpgrade be removed after the 3.1 branch?<br><br><div class="gmail_quote">On Mon, Apr 16, 2012 at 11:52 AM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On Apr 15, 2012, at 3:43 PM, Craig Topper wrote:<br>
<br>
> Author: ctopper<br>
> Date: Sun Apr 15 17:43:31 2012<br>
> New Revision: 154778<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=154778&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=154778&view=rev</a><br>
> Log:<br>
> Remove AVX2 vpermq and vpermpd intrinsics. These can now be handled with normal shuffle vectors.<br>
<br>
Nice!  Were these intrinsics supported in previous released versions of llvm?  If so, we'll need autoupgrade (lib/VMCore/AutoUpgrade.cpp) logic to turn the intrinsic (in old bc files) into the shufflevector.<br>
<br>
-Chris<br>
<br>
><br>
> Modified:<br>
>    llvm/trunk/include/llvm/IntrinsicsX86.td<br>
>    llvm/trunk/lib/Target/X86/X86InstrSSE.td<br>
>    llvm/trunk/test/CodeGen/X86/avx2-intrinsics-x86.ll<br>
><br>
> Modified: llvm/trunk/include/llvm/IntrinsicsX86.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=154778&r1=154777&r2=154778&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=154778&r1=154777&r2=154778&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/include/llvm/IntrinsicsX86.td (original)<br>
> +++ llvm/trunk/include/llvm/IntrinsicsX86.td Sun Apr 15 17:43:31 2012<br>
> @@ -1659,15 +1659,9 @@<br>
>   def int_x86_avx2_permd : GCCBuiltin<"__builtin_ia32_permvarsi256">,<br>
>               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],<br>
>                         [IntrNoMem]>;<br>
> -  def int_x86_avx2_permq : GCCBuiltin<"__builtin_ia32_permdi256">,<br>
> -              Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_i8_ty],<br>
> -                        [IntrNoMem]>;<br>
>   def int_x86_avx2_permps : GCCBuiltin<"__builtin_ia32_permvarsf256">,<br>
>               Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],<br>
>                         [IntrNoMem]>;<br>
> -  def int_x86_avx2_permpd : GCCBuiltin<"__builtin_ia32_permdf256">,<br>
> -              Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i8_ty],<br>
> -                        [IntrNoMem]>;<br>
>   def int_x86_avx2_vperm2i128 : GCCBuiltin<"__builtin_ia32_permti256">,<br>
>               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,<br>
>                          llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;<br>
><br>
> Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=154778&r1=154777&r2=154778&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=154778&r1=154777&r2=154778&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)<br>
> +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Sun Apr 15 17:43:31 2012<br>
> @@ -7755,24 +7755,26 @@<br>
> defm VPERMPS : avx2_perm<0x16, "vpermps", memopv8f32, int_x86_avx2_permps>;<br>
><br>
> multiclass avx2_perm_imm<bits<8> opc, string OpcodeStr, PatFrag mem_frag,<br>
> -                         Intrinsic Int> {<br>
> +                         SDNode OpNode, ValueType OpVT> {<br>
>   def Yri : AVX2AIi8<opc, MRMSrcReg, (outs VR256:$dst),<br>
>                      (ins VR256:$src1, i8imm:$src2),<br>
>                      !strconcat(OpcodeStr,<br>
>                          "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),<br>
> -                     [(set VR256:$dst, (Int VR256:$src1, imm:$src2))]>, VEX;<br>
> +                     [(set VR256:$dst,<br>
> +                       (OpVT (OpNode VR256:$src1, (i8 imm:$src2))))]>, VEX;<br>
>   def Ymi : AVX2AIi8<opc, MRMSrcMem, (outs VR256:$dst),<br>
>                      (ins i256mem:$src1, i8imm:$src2),<br>
>                      !strconcat(OpcodeStr,<br>
>                          "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),<br>
> -                     [(set VR256:$dst, (Int (mem_frag addr:$src1), imm:$src2))]>,<br>
> +                     [(set VR256:$dst,<br>
> +                       (OpVT (OpNode (mem_frag addr:$src1), (i8 imm:$src2))))]>,<br>
>                      VEX;<br>
> }<br>
><br>
> -defm VPERMQ : avx2_perm_imm<0x00, "vpermq", memopv4i64, int_x86_avx2_permq>,<br>
> +defm VPERMQ : avx2_perm_imm<0x00, "vpermq", memopv4i64, X86VPermq, v4i64>,<br>
>                             VEX_W;<br>
> let ExeDomain = SSEPackedDouble in<br>
> -defm VPERMPD : avx2_perm_imm<0x01, "vpermpd", memopv4f64, int_x86_avx2_permpd>,<br>
> +defm VPERMPD : avx2_perm_imm<0x01, "vpermpd", memopv4f64, X86VPermpd, v4f64>,<br>
>                              VEX_W;<br>
><br>
> let Predicates = [HasAVX2] in {<br>
> @@ -7780,22 +7782,11 @@<br>
>           (VPERMDYrr VR256:$src1, VR256:$src2)>;<br>
> def : Pat<(v8f32 (X86VPermps VR256:$src1, VR256:$src2)),<br>
>           (VPERMPSYrr VR256:$src1, VR256:$src2)>;<br>
> -<br>
> -def : Pat<(v4i64 (X86VPermq VR256:$src1, (i8 imm:$imm))),<br>
> -          (VPERMQYri VR256:$src1, imm:$imm)>;<br>
> -def : Pat<(v4f64 (X86VPermpd VR256:$src1, (i8 imm:$imm))),<br>
> -          (VPERMPDYri VR256:$src1, imm:$imm)>;<br>
><br>
> -def : Pat<(v8i32 (X86VPermps VR256:$src1, (bc_v8i32 (memopv4i64 addr:$src2)))),<br>
> +def : Pat<(v8i32 (X86VPermd VR256:$src1, (bc_v8i32 (memopv4i64 addr:$src2)))),<br>
>           (VPERMDYrm VR256:$src1, addr:$src2)>;<br>
> def : Pat<(v8f32 (X86VPermps VR256:$src1, (memopv8f32 addr:$src2))),<br>
>           (VPERMPSYrm VR256:$src1, addr:$src2)>;<br>
> -<br>
> -def : Pat<(v4i64 (X86VPermq (memopv4i64 addr:$src1), (i8 imm:$imm))),<br>
> -          (VPERMQYmi addr:$src1, imm:$imm)>;<br>
> -def : Pat<(v4f64 (X86VPermpd (memopv4f64 addr:$src1), (i8 imm:$imm))),<br>
> -          (VPERMPDYmi addr:$src1, imm:$imm)>;<br>
> -<br>
> }<br>
><br>
> //===----------------------------------------------------------------------===//<br>
><br>
> Modified: llvm/trunk/test/CodeGen/X86/avx2-intrinsics-x86.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx2-intrinsics-x86.ll?rev=154778&r1=154777&r2=154778&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx2-intrinsics-x86.ll?rev=154778&r1=154777&r2=154778&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/test/CodeGen/X86/avx2-intrinsics-x86.ll (original)<br>
> +++ llvm/trunk/test/CodeGen/X86/avx2-intrinsics-x86.ll Sun Apr 15 17:43:31 2012<br>
> @@ -800,22 +800,6 @@<br>
> declare <8 x float> @llvm.x86.avx2.permps(<8 x float>, <8 x float>) nounwind readonly<br>
><br>
><br>
> -define <4 x i64> @test_x86_avx2_permq(<4 x i64> %a0) {<br>
> -  ; CHECK: vpermq<br>
> -  %res = call <4 x i64> @llvm.x86.avx2.permq(<4 x i64> %a0, i8 7) ; <<4 x i64>> [#uses=1]<br>
> -  ret <4 x i64> %res<br>
> -}<br>
> -declare <4 x i64> @llvm.x86.avx2.permq(<4 x i64>, i8) nounwind readonly<br>
> -<br>
> -<br>
> -define <4 x double> @test_x86_avx2_permpd(<4 x double> %a0) {<br>
> -  ; CHECK: vpermpd<br>
> -  %res = call <4 x double> @llvm.x86.avx2.permpd(<4 x double> %a0, i8 7) ; <<4 x double>> [#uses=1]<br>
> -  ret <4 x double> %res<br>
> -}<br>
> -declare <4 x double> @llvm.x86.avx2.permpd(<4 x double>, i8) nounwind readonly<br>
> -<br>
> -<br>
> define <4 x i64> @test_x86_avx2_vperm2i128(<4 x i64> %a0, <4 x i64> %a1) {<br>
>   ; CHECK: vperm2i128<br>
>   %res = call <4 x i64> @llvm.x86.avx2.vperm2i128(<4 x i64> %a0, <4 x i64> %a1, i8 1) ; <<4 x i64>> [#uses=1]<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>~Craig<br>