@@ -3684,6 +3684,15 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
3684
3684
3685
3685
case Intrinsic::x86_mmx_packssdw:
3686
3686
return Intrinsic::x86_mmx_packssdw;
3687
+
3688
+ case Intrinsic::x86_avx512_packssdw_512:
3689
+ case Intrinsic::x86_avx512_packusdw_512:
3690
+ return Intrinsic::x86_avx512_packssdw_512;
3691
+
3692
+ case Intrinsic::x86_avx512_packsswb_512:
3693
+ case Intrinsic::x86_avx512_packuswb_512:
3694
+ return Intrinsic::x86_avx512_packsswb_512;
3695
+
3687
3696
default :
3688
3697
llvm_unreachable (" unexpected intrinsic id" );
3689
3698
}
@@ -3696,6 +3705,8 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
3696
3705
// Shadow is propagated with the signed variant of the same intrinsic applied
3697
3706
// to sext(Sa != zeroinitializer), sext(Sb != zeroinitializer).
3698
3707
// MMXEltSizeInBits is used only for x86mmx arguments.
3708
+ //
3709
+ // TODO: consider using GetMinMaxUnsigned() to handle saturation precisely
3699
3710
void handleVectorPackIntrinsic (IntrinsicInst &I,
3700
3711
unsigned MMXEltSizeInBits = 0 ) {
3701
3712
assert (I.arg_size () == 2 );
@@ -5554,6 +5565,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
5554
5565
handleVectorShiftIntrinsic (I, /* Variable */ true );
5555
5566
break ;
5556
5567
5568
+ // Pack with Signed/Unsigned Saturation
5557
5569
case Intrinsic::x86_sse2_packsswb_128:
5558
5570
case Intrinsic::x86_sse2_packssdw_128:
5559
5571
case Intrinsic::x86_sse2_packuswb_128:
@@ -5562,6 +5574,15 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
5562
5574
case Intrinsic::x86_avx2_packssdw:
5563
5575
case Intrinsic::x86_avx2_packuswb:
5564
5576
case Intrinsic::x86_avx2_packusdw:
5577
+ // e.g., <64 x i8> @llvm.x86.avx512.packsswb.512
5578
+ // (<32 x i16> %a, <32 x i16> %b)
5579
+ // <32 x i16> @llvm.x86.avx512.packssdw.512
5580
+ // (<16 x i32> %a, <16 x i32> %b)
5581
+ // Note: AVX512 masked variants are auto-upgraded by LLVM.
5582
+ case Intrinsic::x86_avx512_packsswb_512:
5583
+ case Intrinsic::x86_avx512_packssdw_512:
5584
+ case Intrinsic::x86_avx512_packuswb_512:
5585
+ case Intrinsic::x86_avx512_packusdw_512:
5565
5586
handleVectorPackIntrinsic (I);
5566
5587
break ;
5567
5588
0 commit comments