Skip to content

Commit

Permalink
[X86] Don't use types when getting the intrinsic declaration for x86_…
Browse files Browse the repository at this point in the history
…avx512_mask_vcvtph2ps_512.

This intrinsic isn't overloaded so we should query with types.
Doing so causes the backend to miss the intrinsic and not codegen it.
This eventually leads to a linker error.
  • Loading branch information
topperc committed Apr 24, 2020
1 parent 238f00f commit 0ed5b0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions clang/lib/CodeGen/CGBuiltin.cpp
Expand Up @@ -10961,10 +10961,8 @@ static Value *EmitX86CvtF16ToFloatExpr(CodeGenFunction &CGF,

// If the SAE intrinsic doesn't use default rounding then we can't upgrade.
if (Ops.size() == 4 && cast<llvm::ConstantInt>(Ops[3])->getZExtValue() != 4) {
Intrinsic::ID IID = Intrinsic::x86_avx512_mask_vcvtph2ps_512;
Function *F =
CGF.CGM.getIntrinsic(IID, {DstTy, Ops[0]->getType(), Ops[1]->getType(),
Ops[2]->getType(), Ops[3]->getType()});
CGF.CGM.getIntrinsic(Intrinsic::x86_avx512_mask_vcvtph2ps_512);
return CGF.Builder.CreateCall(F, {Ops[0], Ops[1], Ops[2], Ops[3]});
}

Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGen/avx512f-builtins.c
Expand Up @@ -4976,21 +4976,21 @@ __m256i test_mm512_maskz_cvt_roundps_ph(__mmask16 __U, __m512 __A)
__m512 test_mm512_cvt_roundph_ps(__m256i __A)
{
// CHECK-LABEL: @test_mm512_cvt_roundph_ps
// CHECK: @llvm.x86.avx512.mask.vcvtph2ps.512
// CHECK: @llvm.x86.avx512.mask.vcvtph2ps.512(
return _mm512_cvt_roundph_ps(__A, _MM_FROUND_NO_EXC);
}

__m512 test_mm512_mask_cvt_roundph_ps(__m512 __W, __mmask16 __U, __m256i __A)
{
// CHECK-LABEL: @test_mm512_mask_cvt_roundph_ps
// CHECK: @llvm.x86.avx512.mask.vcvtph2ps.512
// CHECK: @llvm.x86.avx512.mask.vcvtph2ps.512(
return _mm512_mask_cvt_roundph_ps(__W, __U, __A, _MM_FROUND_NO_EXC);
}

__m512 test_mm512_maskz_cvt_roundph_ps(__mmask16 __U, __m256i __A)
{
// CHECK-LABEL: @test_mm512_maskz_cvt_roundph_ps
// CHECK: @llvm.x86.avx512.mask.vcvtph2ps.512
// CHECK: @llvm.x86.avx512.mask.vcvtph2ps.512(
return _mm512_maskz_cvt_roundph_ps(__U, __A, _MM_FROUND_NO_EXC);
}

Expand Down

0 comments on commit 0ed5b0d

Please sign in to comment.