summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-05-31 06:21:49 +0000
committerCraig Topper <craig.topper@intel.com>2019-05-31 06:21:49 +0000
commit73b07284df2760433da1294f445ea6f8f8eabce9 (patch)
treebcc51e5d00c8c1bed396cc473fe3990985cd6e30 /llvm
parent8cb076ec6e0f49805441c2adc54547c6363adba6 (diff)
downloadbcm5719-llvm-73b07284df2760433da1294f445ea6f8f8eabce9.tar.gz
bcm5719-llvm-73b07284df2760433da1294f445ea6f8f8eabce9.zip
[X86] Add test to show missed opportunity to use masked vcvtps2pd for vselect+extload.
llvm-svn: 362198
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/X86/avx512-cvt.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx512-cvt.ll b/llvm/test/CodeGen/X86/avx512-cvt.ll
index ff1eadcf9ca..aa7f533c1d4 100644
--- a/llvm/test/CodeGen/X86/avx512-cvt.ll
+++ b/llvm/test/CodeGen/X86/avx512-cvt.ll
@@ -778,6 +778,30 @@ define <4 x double> @f32to4f64_mask(<4 x float> %b, <4 x double> %b1, <4 x doubl
ret <4 x double> %c
}
+define <4 x double> @f32to4f64_mask_load(<4 x float>* %p, <4 x double> %b1, <4 x double> %a1) {
+; NOVL-LABEL: f32to4f64_mask_load:
+; NOVL: # %bb.0:
+; NOVL-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
+; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
+; NOVL-NEXT: vcvtps2pd (%rdi), %ymm2
+; NOVL-NEXT: vcmpltpd %zmm1, %zmm0, %k1
+; NOVL-NEXT: vmovapd %zmm2, %zmm0 {%k1} {z}
+; NOVL-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
+; NOVL-NEXT: retq
+;
+; VL-LABEL: f32to4f64_mask_load:
+; VL: # %bb.0:
+; VL-NEXT: vcvtps2pd (%rdi), %ymm2
+; VL-NEXT: vcmpltpd %ymm1, %ymm0, %k1
+; VL-NEXT: vmovapd %ymm2, %ymm0 {%k1} {z}
+; VL-NEXT: retq
+ %b = load <4 x float>, <4 x float>* %p
+ %a = fpext <4 x float> %b to <4 x double>
+ %mask = fcmp ogt <4 x double> %a1, %b1
+ %c = select <4 x i1> %mask, <4 x double> %a, <4 x double> zeroinitializer
+ ret <4 x double> %c
+}
+
define <2 x double> @f32tof64_inreg(<2 x double> %a0, <4 x float> %a1) nounwind {
; ALL-LABEL: f32tof64_inreg:
; ALL: # %bb.0:
OpenPOWER on IntegriCloud