From be32016e90b07827ac96a00d6f6346ce651477b7 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 10 Jul 2018 00:49:47 +0000 Subject: [PATCH] [X86] Add test cases that show failure to fold load into vfixupimm instructions due to bad isel pattern. llvm-svn: 336625 --- test/CodeGen/X86/avx512-intrinsics.ll | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/test/CodeGen/X86/avx512-intrinsics.ll b/test/CodeGen/X86/avx512-intrinsics.ll index 0f644a2a928..0cbe96e5998 100644 --- a/test/CodeGen/X86/avx512-intrinsics.ll +++ b/test/CodeGen/X86/avx512-intrinsics.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512f | FileCheck %s +; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mattr=+avx512f | FileCheck %s define <8 x double> @test_mask_compress_pd_512(<8 x double> %data, <8 x double> %passthru, i8 %mask) { @@ -4159,6 +4159,17 @@ define <8 x double>@test_int_x86_avx512_mask_fixupimm_pd_512(<8 x double> %x0, < ret <8 x double> %res4 } +define <8 x double>@test_int_x86_avx512_mask_fixupimm_pd_512_load(<8 x double> %x0, <8 x double> %x1, <8 x i64>* %x2ptr) { +; CHECK-LABEL: test_int_x86_avx512_mask_fixupimm_pd_512_load: +; CHECK: ## %bb.0: +; CHECK-NEXT: vmovapd (%rdi), %zmm2 +; CHECK-NEXT: vfixupimmpd $3, %zmm2, %zmm1, %zmm0 +; CHECK-NEXT: retq + %x2 = load <8 x i64>, <8 x i64>* %x2ptr + %res = call <8 x double> @llvm.x86.avx512.mask.fixupimm.pd.512(<8 x double> %x0, <8 x double> %x1, <8 x i64> %x2, i32 3, i8 -1, i32 4) + ret <8 x double> %res +} + declare <8 x double> @llvm.x86.avx512.maskz.fixupimm.pd.512(<8 x double>, <8 x double>, <8 x i64>, i32, i8, i32) define <8 x double>@test_int_x86_avx512_maskz_fixupimm_pd_512(<8 x double> %x0, <8 x double> %x1, <8 x i64> %x2, i8 %x4) { @@ -4251,6 +4262,17 @@ define <16 x float>@test_int_x86_avx512_mask_fixupimm_ps_512(<16 x float> %x0, < ret <16 x float> %res4 } +define <16 x float>@test_int_x86_avx512_mask_fixupimm_ps_512_load(<16 x float> %x0, <16 x float> %x1, <16 x i32>* %x2ptr) { +; CHECK-LABEL: test_int_x86_avx512_mask_fixupimm_ps_512_load: +; CHECK: ## %bb.0: +; CHECK-NEXT: vmovaps (%rdi), %zmm2 +; CHECK-NEXT: vfixupimmps $5, %zmm2, %zmm1, %zmm0 +; CHECK-NEXT: retq + %x2 = load <16 x i32>, <16 x i32>* %x2ptr + %res = call <16 x float> @llvm.x86.avx512.mask.fixupimm.ps.512(<16 x float> %x0, <16 x float> %x1, <16 x i32> %x2, i32 5, i16 -1, i32 4) + ret <16 x float> %res +} + declare <16 x float> @llvm.x86.avx512.maskz.fixupimm.ps.512(<16 x float>, <16 x float>, <16 x i32>, i32, i16, i32) define <16 x float>@test_int_x86_avx512_maskz_fixupimm_ps_512(<16 x float> %x0, <16 x float> %x1, <16 x i32> %x2, i16 %x4) {