Skip to content

Commit 1b4441b

Browse files
committed
Move convert handlers closer together, update comments
1 parent 6e8d1ea commit 1b4441b

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5345,6 +5345,10 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
53455345
case Intrinsic::x86_sse_ldmxcsr:
53465346
handleLdmxcsr(I);
53475347
break;
5348+
5349+
// Convert Scalar Double Precision Floating-Point Value
5350+
// to Unsigned DoublewordInteger
5351+
// etc.
53485352
case Intrinsic::x86_avx512_vcvtsd2usi64:
53495353
case Intrinsic::x86_avx512_vcvtsd2usi32:
53505354
case Intrinsic::x86_avx512_vcvtss2usi64:
@@ -5386,7 +5390,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
53865390
}
53875391

53885392
// Convert Packed Double Precision Floating-Point Values
5389-
// to Packed Single PrecisionFloating-Point Values
5393+
// to Packed Single Precision Floating-Point Values
53905394
case Intrinsic::x86_sse2_cvtpd2ps:
53915395
case Intrinsic::x86_sse2_cvtps2dq:
53925396
case Intrinsic::x86_sse2_cvtpd2dq:
@@ -5401,6 +5405,29 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
54015405
break;
54025406
}
54035407

5408+
// Convert Packed Single Precision Floating-Point Values
5409+
// to Packed Signed Doubleword Integer Values
5410+
//
5411+
// <16 x i32> @llvm.x86.avx512.mask.cvtps2dq.512
5412+
// (<16 x float>, <16 x i32>, i16, i32)
5413+
case Intrinsic::x86_avx512_mask_cvtps2dq_512: {
5414+
handleAVX512VectorConvertFPToInt(I, /*LastMask=*/false);
5415+
break;
5416+
}
5417+
5418+
// Convert Single-Precision FP Value to 16-bit FP Value
5419+
// <16 x i16> @llvm.x86.avx512.mask.vcvtps2ph.512
5420+
// (<16 x float>, i32, <16 x i16>, i16)
5421+
// <8 x i16> @llvm.x86.avx512.mask.vcvtps2ph.128
5422+
// (<4 x float>, i32, <8 x i16>, i8)
5423+
// <8 x i16> @llvm.x86.avx512.mask.vcvtps2ph.256
5424+
// (<8 x float>, i32, <8 x i16>, i8)
5425+
case Intrinsic::x86_avx512_mask_vcvtps2ph_512:
5426+
case Intrinsic::x86_avx512_mask_vcvtps2ph_256:
5427+
case Intrinsic::x86_avx512_mask_vcvtps2ph_128:
5428+
handleAVX512VectorConvertFPToInt(I, /*LastMask=*/true);
5429+
break;
5430+
54045431
// Shift Packed Data (Left Logical, Right Arithmetic, Right Logical)
54055432
case Intrinsic::x86_avx512_psll_w_512:
54065433
case Intrinsic::x86_avx512_psll_d_512:
@@ -5968,29 +5995,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
59685995
/*trailingVerbatimArgs=*/1);
59695996
break;
59705997

5971-
// Convert Packed Single Precision Floating-Point Values
5972-
// to Packed Signed Doubleword Integer Values
5973-
//
5974-
// <16 x i32> @llvm.x86.avx512.mask.cvtps2dq.512
5975-
// (<16 x float>, <16 x i32>, i16, i32)
5976-
case Intrinsic::x86_avx512_mask_cvtps2dq_512: {
5977-
handleAVX512VectorConvertFPToInt(I, /*LastMask=*/false);
5978-
break;
5979-
}
5980-
5981-
// Convert Single-Precision FP Value to 16-bit FP Value
5982-
// <16 x i16> @llvm.x86.avx512.mask.vcvtps2ph.512
5983-
// (<16 x float>, i32, <16 x i16>, i16)
5984-
// <8 x i16> @llvm.x86.avx512.mask.vcvtps2ph.128
5985-
// (<4 x float>, i32, <8 x i16>, i8)
5986-
// <8 x i16> @llvm.x86.avx512.mask.vcvtps2ph.256
5987-
// (<8 x float>, i32, <8 x i16>, i8)
5988-
case Intrinsic::x86_avx512_mask_vcvtps2ph_512:
5989-
case Intrinsic::x86_avx512_mask_vcvtps2ph_256:
5990-
case Intrinsic::x86_avx512_mask_vcvtps2ph_128:
5991-
handleAVX512VectorConvertFPToInt(I, /*LastMask=*/true);
5992-
break;
5993-
59945998
// AVX512 PMOV: Packed MOV, with truncation
59955999
// Precisely handled by applying the same intrinsic to the shadow
59966000
case Intrinsic::x86_avx512_mask_pmov_dw_512:

0 commit comments

Comments
 (0)