llvm.org GIT mirror llvm / 28daf68
[X86] Remove and autoupgrade avx512.vbroadcast.ss/avx512.vbroadcast.sd intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332271 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 1 year, 5 months ago
5 changed file(s) with 23 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
41064106
41074107 // Vector load with broadcast
41084108 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
4109 // TODO: Remove the broadcast intrinsics with no gcc builtin and autoupgrade
4110 def int_x86_avx512_vbroadcast_ss_512 :
4111 Intrinsic<[llvm_v16f32_ty], [llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>;
4112
4113 def int_x86_avx512_vbroadcast_sd_512 :
4114 Intrinsic<[llvm_v8f64_ty], [llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>;
4115
41164109 def int_x86_avx512_broadcastmw_512 :
41174110 GCCBuiltin<"__builtin_ia32_broadcastmw512">,
41184111 Intrinsic<[llvm_v16i32_ty], [llvm_i16_ty], [IntrNoMem]>;
292292 Name.startswith("avx512.mask.load.") || // Added in 3.9
293293 Name == "sse42.crc32.64.8" || // Added in 3.4
294294 Name.startswith("avx.vbroadcast.s") || // Added in 3.5
295 Name.startswith("avx512.vbroadcast.s") || // Added in 7.0
295296 Name.startswith("avx512.mask.palignr.") || // Added in 3.9
296297 Name.startswith("avx512.mask.valign.") || // Added in 4.0
297298 Name.startswith("sse2.psll.dq") || // Added in 3.7
16751676 Value *Trunc0 = Builder.CreateTrunc(CI->getArgOperand(0), Type::getInt32Ty(C));
16761677 Rep = Builder.CreateCall(CRC32, {Trunc0, CI->getArgOperand(1)});
16771678 Rep = Builder.CreateZExt(Rep, CI->getType(), "");
1678 } else if (IsX86 && Name.startswith("avx.vbroadcast.s")) {
1679 } else if (IsX86 && (Name.startswith("avx.vbroadcast.s") ||
1680 Name.startswith("avx512.vbroadcast.s"))) {
16791681 // Replace broadcasts with a series of insertelements.
16801682 Type *VecTy = CI->getType();
16811683 Type *EltTy = VecTy->getVectorElementType();
12291229 avx512vl_f32_info>;
12301230 defm VBROADCASTSD : avx512_fp_broadcast_sd<0x19, "vbroadcastsd",
12311231 avx512vl_f64_info>, VEX_W;
1232
1233 def : Pat<(int_x86_avx512_vbroadcast_ss_512 addr:$src),
1234 (VBROADCASTSSZm addr:$src)>;
1235 def : Pat<(int_x86_avx512_vbroadcast_sd_512 addr:$src),
1236 (VBROADCASTSDZm addr:$src)>;
12371232
12381233 multiclass avx512_int_broadcast_reg opc, SchedWrite SchedRR,
12391234 X86VectorVTInfo _, SDPatternOperator OpNode,
41304130 ret <2 x double> %res
41314131 }
41324132 declare <2 x double> @llvm.x86.avx512.cvtusi2sd(<2 x double>, i32) nounwind readnone
4133
4134 define <16 x float> @test_x86_vbroadcast_ss_512(i8* %a0) {
4135 ; CHECK-LABEL: test_x86_vbroadcast_ss_512:
4136 ; CHECK: ## %bb.0:
4137 ; CHECK-NEXT: vbroadcastss (%rdi), %zmm0
4138 ; CHECK-NEXT: retq
4139 %res = call <16 x float> @llvm.x86.avx512.vbroadcast.ss.512(i8* %a0) ; <<16 x float>> [#uses=1]
4140 ret <16 x float> %res
4141 }
4142 declare <16 x float> @llvm.x86.avx512.vbroadcast.ss.512(i8*) nounwind readonly
4143
4144 define <8 x double> @test_x86_vbroadcast_sd_512(i8* %a0) {
4145 ; CHECK-LABEL: test_x86_vbroadcast_sd_512:
4146 ; CHECK: ## %bb.0:
4147 ; CHECK-NEXT: vbroadcastsd (%rdi), %zmm0
4148 ; CHECK-NEXT: retq
4149 %res = call <8 x double> @llvm.x86.avx512.vbroadcast.sd.512(i8* %a0) ; <<8 x double>> [#uses=1]
4150 ret <8 x double> %res
4151 }
4152 declare <8 x double> @llvm.x86.avx512.vbroadcast.sd.512(i8*) nounwind readonly
643643 }
644644
645645 declare <16 x i16> @llvm.x86.avx512.mask.vcvtps2ph.512(<16 x float>, i32, <16 x i16>, i16) nounwind readonly
646
647 define <16 x float> @test_x86_vbroadcast_ss_512(i8* %a0) {
648 ; CHECK-LABEL: test_x86_vbroadcast_ss_512:
649 ; CHECK: ## %bb.0:
650 ; CHECK-NEXT: vbroadcastss (%rdi), %zmm0
651 ; CHECK-NEXT: retq
652 %res = call <16 x float> @llvm.x86.avx512.vbroadcast.ss.512(i8* %a0) ; <<16 x float>> [#uses=1]
653 ret <16 x float> %res
654 }
655 declare <16 x float> @llvm.x86.avx512.vbroadcast.ss.512(i8*) nounwind readonly
656
657 define <8 x double> @test_x86_vbroadcast_sd_512(i8* %a0) {
658 ; CHECK-LABEL: test_x86_vbroadcast_sd_512:
659 ; CHECK: ## %bb.0:
660 ; CHECK-NEXT: vbroadcastsd (%rdi), %zmm0
661 ; CHECK-NEXT: retq
662 %res = call <8 x double> @llvm.x86.avx512.vbroadcast.sd.512(i8* %a0) ; <<8 x double>> [#uses=1]
663 ret <8 x double> %res
664 }
665 declare <8 x double> @llvm.x86.avx512.vbroadcast.sd.512(i8*) nounwind readonly
666646
667647 define i16 @test_cmpps(<16 x float> %a, <16 x float> %b) {
668648 ; CHECK-LABEL: test_cmpps: