llvm.org GIT mirror llvm / ae62c59
[X86] Remove IntrArgMemOnly from target specific gather/scatter intrinsics IntrArgMemOnly implies that only memory pointed to by pointer typed arguments will be accessed. But these intrinsics allow you to pass null to the pointer argument and put the full address into the index argument. Other passes won't be able to understand this. A colleague found that ISPC was creating gathers like this and then dead store elimination removed some stores because it didn't understand what the gather was doing since the pointer argument was null. Differential Revision: https://reviews.llvm.org/D58805 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355228 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 6 months ago
2 changed file(s) with 138 addition(s) and 123 deletion(s). Raw diff Collapse all Expand all
16751675
16761676 // Gather ops
16771677 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1678 // NOTE: These can't be ArgMemOnly because you can put the address completely
1679 // in the index register.
16781680 def int_x86_avx2_gather_d_pd : GCCBuiltin<"__builtin_ia32_gatherd_pd">,
16791681 Intrinsic<[llvm_v2f64_ty],
16801682 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i8_ty],
1681 [IntrReadMem, IntrArgMemOnly]>;
1683 [IntrReadMem]>;
16821684 def int_x86_avx2_gather_d_pd_256 : GCCBuiltin<"__builtin_ia32_gatherd_pd256">,
16831685 Intrinsic<[llvm_v4f64_ty],
16841686 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i8_ty],
1685 [IntrReadMem, IntrArgMemOnly]>;
1687 [IntrReadMem]>;
16861688 def int_x86_avx2_gather_q_pd : GCCBuiltin<"__builtin_ia32_gatherq_pd">,
16871689 Intrinsic<[llvm_v2f64_ty],
16881690 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty],
1689 [IntrReadMem, IntrArgMemOnly]>;
1691 [IntrReadMem]>;
16901692 def int_x86_avx2_gather_q_pd_256 : GCCBuiltin<"__builtin_ia32_gatherq_pd256">,
16911693 Intrinsic<[llvm_v4f64_ty],
16921694 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty],
1693 [IntrReadMem, IntrArgMemOnly]>;
1695 [IntrReadMem]>;
16941696 def int_x86_avx2_gather_d_ps : GCCBuiltin<"__builtin_ia32_gatherd_ps">,
16951697 Intrinsic<[llvm_v4f32_ty],
16961698 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty],
1697 [IntrReadMem, IntrArgMemOnly]>;
1699 [IntrReadMem]>;
16981700 def int_x86_avx2_gather_d_ps_256 : GCCBuiltin<"__builtin_ia32_gatherd_ps256">,
16991701 Intrinsic<[llvm_v8f32_ty],
17001702 [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty],
1701 [IntrReadMem, IntrArgMemOnly]>;
1703 [IntrReadMem]>;
17021704 def int_x86_avx2_gather_q_ps : GCCBuiltin<"__builtin_ia32_gatherq_ps">,
17031705 Intrinsic<[llvm_v4f32_ty],
17041706 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
1705 [IntrReadMem, IntrArgMemOnly]>;
1707 [IntrReadMem]>;
17061708 def int_x86_avx2_gather_q_ps_256 : GCCBuiltin<"__builtin_ia32_gatherq_ps256">,
17071709 Intrinsic<[llvm_v4f32_ty],
17081710 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i8_ty],
1709 [IntrReadMem, IntrArgMemOnly]>;
1711 [IntrReadMem]>;
17101712
17111713 def int_x86_avx2_gather_d_q : GCCBuiltin<"__builtin_ia32_gatherd_q">,
17121714 Intrinsic<[llvm_v2i64_ty],
17131715 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i8_ty],
1714 [IntrReadMem, IntrArgMemOnly]>;
1716 [IntrReadMem]>;
17151717 def int_x86_avx2_gather_d_q_256 : GCCBuiltin<"__builtin_ia32_gatherd_q256">,
17161718 Intrinsic<[llvm_v4i64_ty],
17171719 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i8_ty],
1718 [IntrReadMem, IntrArgMemOnly]>;
1720 [IntrReadMem]>;
17191721 def int_x86_avx2_gather_q_q : GCCBuiltin<"__builtin_ia32_gatherq_q">,
17201722 Intrinsic<[llvm_v2i64_ty],
17211723 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
1722 [IntrReadMem, IntrArgMemOnly]>;
1724 [IntrReadMem]>;
17231725 def int_x86_avx2_gather_q_q_256 : GCCBuiltin<"__builtin_ia32_gatherq_q256">,
17241726 Intrinsic<[llvm_v4i64_ty],
17251727 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
1726 [IntrReadMem, IntrArgMemOnly]>;
1728 [IntrReadMem]>;
17271729 def int_x86_avx2_gather_d_d : GCCBuiltin<"__builtin_ia32_gatherd_d">,
17281730 Intrinsic<[llvm_v4i32_ty],
17291731 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
1730 [IntrReadMem, IntrArgMemOnly]>;
1732 [IntrReadMem]>;
17311733 def int_x86_avx2_gather_d_d_256 : GCCBuiltin<"__builtin_ia32_gatherd_d256">,
17321734 Intrinsic<[llvm_v8i32_ty],
17331735 [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
1734 [IntrReadMem, IntrArgMemOnly]>;
1736 [IntrReadMem]>;
17351737 def int_x86_avx2_gather_q_d : GCCBuiltin<"__builtin_ia32_gatherq_d">,
17361738 Intrinsic<[llvm_v4i32_ty],
17371739 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
1738 [IntrReadMem, IntrArgMemOnly]>;
1740 [IntrReadMem]>;
17391741 def int_x86_avx2_gather_q_d_256 : GCCBuiltin<"__builtin_ia32_gatherq_d256">,
17401742 Intrinsic<[llvm_v4i32_ty],
17411743 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
1742 [IntrReadMem, IntrArgMemOnly]>;
1744 [IntrReadMem]>;
17431745 }
17441746
17451747 // Misc.
34973499 // Gather and Scatter ops
34983500 let TargetPrefix = "x86" in {
34993501 // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
3502 // NOTE: These can't be ArgMemOnly because you can put the address completely
3503 // in the index register.
35003504 def int_x86_avx512_gather_dpd_512 :
35013505 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
35023506 llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3503 [IntrReadMem, IntrArgMemOnly]>;
3507 [IntrReadMem]>;
35043508 def int_x86_avx512_gather_dps_512 :
35053509 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
35063510 llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
3507 [IntrReadMem, IntrArgMemOnly]>;
3511 [IntrReadMem]>;
35083512 def int_x86_avx512_gather_qpd_512 :
35093513 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
35103514 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3511 [IntrReadMem, IntrArgMemOnly]>;
3515 [IntrReadMem]>;
35123516 def int_x86_avx512_gather_qps_512 :
35133517 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
35143518 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3515 [IntrReadMem, IntrArgMemOnly]>;
3519 [IntrReadMem]>;
35163520
35173521
35183522 def int_x86_avx512_gather_dpq_512 :
35193523 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
35203524 llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3521 [IntrReadMem, IntrArgMemOnly]>;
3525 [IntrReadMem]>;
35223526 def int_x86_avx512_gather_dpi_512 :
35233527 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
35243528 llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
3525 [IntrReadMem, IntrArgMemOnly]>;
3529 [IntrReadMem]>;
35263530 def int_x86_avx512_gather_qpq_512 :
35273531 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
35283532 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3529 [IntrReadMem, IntrArgMemOnly]>;
3533 [IntrReadMem]>;
35303534 def int_x86_avx512_gather_qpi_512 :
35313535 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
35323536 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3533 [IntrReadMem, IntrArgMemOnly]>;
3537 [IntrReadMem]>;
35343538
35353539 def int_x86_avx512_gather3div2_df :
35363540 Intrinsic<[llvm_v2f64_ty],
35373541 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3538 [IntrReadMem, IntrArgMemOnly]>;
3542 [IntrReadMem]>;
35393543
35403544 def int_x86_avx512_gather3div2_di :
35413545 Intrinsic<[llvm_v2i64_ty],
35423546 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3543 [IntrReadMem, IntrArgMemOnly]>;
3547 [IntrReadMem]>;
35443548
35453549 def int_x86_avx512_gather3div4_df :
35463550 Intrinsic<[llvm_v4f64_ty],
35473551 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3548 [IntrReadMem, IntrArgMemOnly]>;
3552 [IntrReadMem]>;
35493553
35503554 def int_x86_avx512_gather3div4_di :
35513555 Intrinsic<[llvm_v4i64_ty],
35523556 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3553 [IntrReadMem, IntrArgMemOnly]>;
3557 [IntrReadMem]>;
35543558
35553559 def int_x86_avx512_gather3div4_sf :
35563560 Intrinsic<[llvm_v4f32_ty],
35573561 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3558 [IntrReadMem, IntrArgMemOnly]>;
3562 [IntrReadMem]>;
35593563
35603564 def int_x86_avx512_gather3div4_si :
35613565 Intrinsic<[llvm_v4i32_ty],
35623566 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3563 [IntrReadMem, IntrArgMemOnly]>;
3567 [IntrReadMem]>;
35643568
35653569 def int_x86_avx512_gather3div8_sf :
35663570 Intrinsic<[llvm_v4f32_ty],
35673571 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3568 [IntrReadMem, IntrArgMemOnly]>;
3572 [IntrReadMem]>;
35693573
35703574 def int_x86_avx512_gather3div8_si :
35713575 Intrinsic<[llvm_v4i32_ty],
35723576 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3573 [IntrReadMem, IntrArgMemOnly]>;
3577 [IntrReadMem]>;
35743578
35753579 def int_x86_avx512_gather3siv2_df :
35763580 Intrinsic<[llvm_v2f64_ty],
35773581 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3578 [IntrReadMem, IntrArgMemOnly]>;
3582 [IntrReadMem]>;
35793583
35803584 def int_x86_avx512_gather3siv2_di :
35813585 Intrinsic<[llvm_v2i64_ty],
35823586 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3583 [IntrReadMem, IntrArgMemOnly]>;
3587 [IntrReadMem]>;
35843588
35853589 def int_x86_avx512_gather3siv4_df :
35863590 Intrinsic<[llvm_v4f64_ty],
35873591 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3588 [IntrReadMem, IntrArgMemOnly]>;
3592 [IntrReadMem]>;
35893593
35903594 def int_x86_avx512_gather3siv4_di :
35913595 Intrinsic<[llvm_v4i64_ty],
35923596 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3593 [IntrReadMem, IntrArgMemOnly]>;
3597 [IntrReadMem]>;
35943598
35953599 def int_x86_avx512_gather3siv4_sf :
35963600 Intrinsic<[llvm_v4f32_ty],
35973601 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3598 [IntrReadMem, IntrArgMemOnly]>;
3602 [IntrReadMem]>;
35993603
36003604 def int_x86_avx512_gather3siv4_si :
36013605 Intrinsic<[llvm_v4i32_ty],
36023606 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3603 [IntrReadMem, IntrArgMemOnly]>;
3607 [IntrReadMem]>;
36043608
36053609 def int_x86_avx512_gather3siv8_sf :
36063610 Intrinsic<[llvm_v8f32_ty],
36073611 [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3608 [IntrReadMem, IntrArgMemOnly]>;
3612 [IntrReadMem]>;
36093613
36103614 def int_x86_avx512_gather3siv8_si :
36113615 Intrinsic<[llvm_v8i32_ty],
36123616 [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3613 [IntrReadMem, IntrArgMemOnly]>;
3617 [IntrReadMem]>;
36143618
36153619 // scatter
36163620 // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
3621 // NOTE: These can't be ArgMemOnly because you can put the address completely
3622 // in the index register.
36173623 def int_x86_avx512_scatter_dpd_512 :
36183624 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
36193625 llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
3620 [IntrArgMemOnly]>;
3626 []>;
36213627 def int_x86_avx512_scatter_dps_512 :
36223628 Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
36233629 llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
3624 [IntrArgMemOnly]>;
3630 []>;
36253631 def int_x86_avx512_scatter_qpd_512 :
36263632 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
36273633 llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
3628 [IntrArgMemOnly]>;
3634 []>;
36293635 def int_x86_avx512_scatter_qps_512 :
36303636 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
36313637 llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
3632 [IntrArgMemOnly]>;
3638 []>;
36333639
36343640
36353641 def int_x86_avx512_scatter_dpq_512 :
36363642 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
36373643 llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
3638 [IntrArgMemOnly]>;
3644 []>;
36393645 def int_x86_avx512_scatter_dpi_512 :
36403646 Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
36413647 llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
3642 [IntrArgMemOnly]>;
3648 []>;
36433649 def int_x86_avx512_scatter_qpq_512 :
36443650 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,llvm_v8i64_ty, llvm_v8i64_ty,
36453651 llvm_i32_ty],
3646 [IntrArgMemOnly]>;
3652 []>;
36473653 def int_x86_avx512_scatter_qpi_512 :
36483654 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_v8i32_ty,
36493655 llvm_i32_ty],
3650 [IntrArgMemOnly]>;
3656 []>;
36513657
36523658 def int_x86_avx512_scatterdiv2_df :
36533659 Intrinsic<[],
36543660 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
3655 [IntrArgMemOnly]>;
3661 []>;
36563662
36573663 def int_x86_avx512_scatterdiv2_di :
36583664 Intrinsic<[],
36593665 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
3660 [IntrArgMemOnly]>;
3666 []>;
36613667
36623668 def int_x86_avx512_scatterdiv4_df :
36633669 Intrinsic<[],
36643670 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
3665 [IntrArgMemOnly]>;
3671 []>;
36663672
36673673 def int_x86_avx512_scatterdiv4_di :
36683674 Intrinsic<[],
36693675 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
3670 [IntrArgMemOnly]>;
3676 []>;
36713677
36723678 def int_x86_avx512_scatterdiv4_sf :
36733679 Intrinsic<[],
36743680 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
3675 [IntrArgMemOnly]>;
3681 []>;
36763682
36773683 def int_x86_avx512_scatterdiv4_si :
36783684 Intrinsic<[],
36793685 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
3680 [IntrArgMemOnly]>;
3686 []>;
36813687
36823688 def int_x86_avx512_scatterdiv8_sf :
36833689 Intrinsic<[],
36843690 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
3685 [IntrArgMemOnly]>;
3691 []>;
36863692
36873693 def int_x86_avx512_scatterdiv8_si :
36883694 Intrinsic<[],
36893695 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
3690 [IntrArgMemOnly]>;
3696 []>;
36913697
36923698 def int_x86_avx512_scattersiv2_df :
36933699 Intrinsic<[],
36943700 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
3695 [IntrArgMemOnly]>;
3701 []>;
36963702
36973703 def int_x86_avx512_scattersiv2_di :
36983704 Intrinsic<[],
36993705 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
3700 [IntrArgMemOnly]>;
3706 []>;
37013707
37023708 def int_x86_avx512_scattersiv4_df :
37033709 Intrinsic<[],
37043710 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
3705 [IntrArgMemOnly]>;
3711 []>;
37063712
37073713 def int_x86_avx512_scattersiv4_di :
37083714 Intrinsic<[],
37093715 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
3710 [IntrArgMemOnly]>;
3716 []>;
37113717
37123718 def int_x86_avx512_scattersiv4_sf :
37133719 Intrinsic<[],
37143720 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
3715 [IntrArgMemOnly]>;
3721 []>;
37163722
37173723 def int_x86_avx512_scattersiv4_si :
37183724 Intrinsic<[],
37193725 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
3720 [IntrArgMemOnly]>;
3726 []>;
37213727
37223728 def int_x86_avx512_scattersiv8_sf :
37233729 Intrinsic<[],
37243730 [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
3725 [IntrArgMemOnly]>;
3731 []>;
37263732
37273733 def int_x86_avx512_scattersiv8_si :
37283734 Intrinsic<[],
37293735 [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
3730 [IntrArgMemOnly]>;
3736 []>;
37313737
37323738 // gather prefetch
3739 // NOTE: These can't be ArgMemOnly because you can put the address completely
3740 // in the index register.
37333741 def int_x86_avx512_gatherpf_dpd_512 : GCCBuiltin<"__builtin_ia32_gatherpfdpd">,
37343742 Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
3735 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3743 llvm_i32_ty, llvm_i32_ty], []>;
37363744 def int_x86_avx512_gatherpf_dps_512 : GCCBuiltin<"__builtin_ia32_gatherpfdps">,
37373745 Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
3738 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3746 llvm_i32_ty, llvm_i32_ty], []>;
37393747 def int_x86_avx512_gatherpf_qpd_512 : GCCBuiltin<"__builtin_ia32_gatherpfqpd">,
37403748 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3741 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3749 llvm_i32_ty, llvm_i32_ty], []>;
37423750 def int_x86_avx512_gatherpf_qps_512 : GCCBuiltin<"__builtin_ia32_gatherpfqps">,
37433751 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3744 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3752 llvm_i32_ty, llvm_i32_ty], []>;
37453753
37463754 // scatter prefetch
3755 // NOTE: These can't be ArgMemOnly because you can put the address completely
3756 // in the index register.
37473757 def int_x86_avx512_scatterpf_dpd_512 : GCCBuiltin<"__builtin_ia32_scatterpfdpd">,
37483758 Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
3749 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3759 llvm_i32_ty, llvm_i32_ty], []>;
37503760 def int_x86_avx512_scatterpf_dps_512 : GCCBuiltin<"__builtin_ia32_scatterpfdps">,
37513761 Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
3752 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3762 llvm_i32_ty, llvm_i32_ty], []>;
37533763 def int_x86_avx512_scatterpf_qpd_512 : GCCBuiltin<"__builtin_ia32_scatterpfqpd">,
37543764 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3755 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3765 llvm_i32_ty, llvm_i32_ty], []>;
37563766 def int_x86_avx512_scatterpf_qps_512 : GCCBuiltin<"__builtin_ia32_scatterpfqps">,
37573767 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3758 llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
3768 llvm_i32_ty, llvm_i32_ty], []>;
37593769 }
37603770
37613771 // AVX512 gather/scatter intrinsics that use vXi1 masks.
37623772 let TargetPrefix = "x86" in {
3773 // NOTE: These can't be ArgMemOnly because you can put the address completely
3774 // in the index register.
37633775 def int_x86_avx512_mask_gather_dpd_512 :
37643776 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
37653777 llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3766 [IntrReadMem, IntrArgMemOnly]>;
3778 [IntrReadMem]>;
37673779 def int_x86_avx512_mask_gather_dps_512 :
37683780 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
37693781 llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
3770 [IntrReadMem, IntrArgMemOnly]>;
3782 [IntrReadMem]>;
37713783 def int_x86_avx512_mask_gather_qpd_512 :
37723784 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
37733785 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3774 [IntrReadMem, IntrArgMemOnly]>;
3786 [IntrReadMem]>;
37753787 def int_x86_avx512_mask_gather_qps_512 :
37763788 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
37773789 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3778 [IntrReadMem, IntrArgMemOnly]>;
3790 [IntrReadMem]>;
37793791
37803792
37813793 def int_x86_avx512_mask_gather_dpq_512 :
37823794 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
37833795 llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3784 [IntrReadMem, IntrArgMemOnly]>;
3796 [IntrReadMem]>;
37853797 def int_x86_avx512_mask_gather_dpi_512 :
37863798 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
37873799 llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
3788 [IntrReadMem, IntrArgMemOnly]>;
3800 [IntrReadMem]>;
37893801 def int_x86_avx512_mask_gather_qpq_512 :
37903802 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
37913803 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3792 [IntrReadMem, IntrArgMemOnly]>;
3804 [IntrReadMem]>;
37933805 def int_x86_avx512_mask_gather_qpi_512 :
37943806 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
37953807 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3796 [IntrReadMem, IntrArgMemOnly]>;
3808 [IntrReadMem]>;
37973809
37983810 def int_x86_avx512_mask_gather3div2_df :
37993811 Intrinsic<[llvm_v2f64_ty],
38003812 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3801 [IntrReadMem, IntrArgMemOnly]>;
3813 [IntrReadMem]>;
38023814
38033815 def int_x86_avx512_mask_gather3div2_di :
38043816 Intrinsic<[llvm_v2i64_ty],
38053817 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3806 [IntrReadMem, IntrArgMemOnly]>;
3818 [IntrReadMem]>;
38073819
38083820 def int_x86_avx512_mask_gather3div4_df :
38093821 Intrinsic<[llvm_v4f64_ty],
38103822 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3811 [IntrReadMem, IntrArgMemOnly]>;
3823 [IntrReadMem]>;
38123824
38133825 def int_x86_avx512_mask_gather3div4_di :
38143826 Intrinsic<[llvm_v4i64_ty],
38153827 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3816 [IntrReadMem, IntrArgMemOnly]>;
3828 [IntrReadMem]>;
38173829
38183830 def int_x86_avx512_mask_gather3div4_sf :
38193831 Intrinsic<[llvm_v4f32_ty],
38203832 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3821 [IntrReadMem, IntrArgMemOnly]>;
3833 [IntrReadMem]>;
38223834
38233835 def int_x86_avx512_mask_gather3div4_si :
38243836 Intrinsic<[llvm_v4i32_ty],
38253837 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3826 [IntrReadMem, IntrArgMemOnly]>;
3838 [IntrReadMem]>;
38273839
38283840 def int_x86_avx512_mask_gather3div8_sf :
38293841 Intrinsic<[llvm_v4f32_ty],
38303842 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3831 [IntrReadMem, IntrArgMemOnly]>;
3843 [IntrReadMem]>;
38323844
38333845 def int_x86_avx512_mask_gather3div8_si :
38343846 Intrinsic<[llvm_v4i32_ty],
38353847 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3836 [IntrReadMem, IntrArgMemOnly]>;
3848 [IntrReadMem]>;
38373849
38383850 def int_x86_avx512_mask_gather3siv2_df :
38393851 Intrinsic<[llvm_v2f64_ty],
38403852 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
3841 [IntrReadMem, IntrArgMemOnly]>;
3853 [IntrReadMem]>;
38423854
38433855 def int_x86_avx512_mask_gather3siv2_di :
38443856 Intrinsic<[llvm_v2i64_ty],
38453857 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
3846 [IntrReadMem, IntrArgMemOnly]>;
3858 [IntrReadMem]>;
38473859
38483860 def int_x86_avx512_mask_gather3siv4_df :
38493861 Intrinsic<[llvm_v4f64_ty],
38503862 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3851 [IntrReadMem, IntrArgMemOnly]>;
3863 [IntrReadMem]>;
38523864
38533865 def int_x86_avx512_mask_gather3siv4_di :
38543866 Intrinsic<[llvm_v4i64_ty],
38553867 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3856 [IntrReadMem, IntrArgMemOnly]>;
3868 [IntrReadMem]>;
38573869
38583870 def int_x86_avx512_mask_gather3siv4_sf :
38593871 Intrinsic<[llvm_v4f32_ty],
38603872 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3861 [IntrReadMem, IntrArgMemOnly]>;
3873 [IntrReadMem]>;
38623874
38633875 def int_x86_avx512_mask_gather3siv4_si :
38643876 Intrinsic<[llvm_v4i32_ty],
38653877 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3866 [IntrReadMem, IntrArgMemOnly]>;
3878 [IntrReadMem]>;
38673879
38683880 def int_x86_avx512_mask_gather3siv8_sf :
38693881 Intrinsic<[llvm_v8f32_ty],
38703882 [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3871 [IntrReadMem, IntrArgMemOnly]>;
3883 [IntrReadMem]>;
38723884
38733885 def int_x86_avx512_mask_gather3siv8_si :
38743886 Intrinsic<[llvm_v8i32_ty],
38753887 [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3876 [IntrReadMem, IntrArgMemOnly]>;
3888 [IntrReadMem]>;
38773889
38783890 def int_x86_avx512_mask_scatter_dpd_512 :
38793891 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
38803892 llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
3881 [IntrArgMemOnly]>;
3893 []>;
38823894 def int_x86_avx512_mask_scatter_dps_512 :
38833895 Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
38843896 llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
3885 [IntrArgMemOnly]>;
3897 []>;
38863898 def int_x86_avx512_mask_scatter_qpd_512 :
38873899 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
38883900 llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
3889 [IntrArgMemOnly]>;
3901 []>;
38903902 def int_x86_avx512_mask_scatter_qps_512 :
38913903 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
38923904 llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
3893 [IntrArgMemOnly]>;
3894
3895
3905 []>;
3906
3907
3908 // NOTE: These can't be ArgMemOnly because you can put the address completely
3909 // in the index register.
38963910 def int_x86_avx512_mask_scatter_dpq_512 :
38973911 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
38983912 llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
3899 [IntrArgMemOnly]>;
3913 []>;
39003914 def int_x86_avx512_mask_scatter_dpi_512 :
39013915 Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
39023916 llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
3903 [IntrArgMemOnly]>;
3917 []>;
39043918 def int_x86_avx512_mask_scatter_qpq_512 :
39053919 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,llvm_v8i64_ty, llvm_v8i64_ty,
39063920 llvm_i32_ty],
3907 [IntrArgMemOnly]>;
3921 []>;
39083922 def int_x86_avx512_mask_scatter_qpi_512 :
39093923 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i64_ty, llvm_v8i32_ty,
39103924 llvm_i32_ty],
3911 [IntrArgMemOnly]>;
3925 []>;
39123926
39133927 def int_x86_avx512_mask_scatterdiv2_df :
39143928 Intrinsic<[],
39153929 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
3916 [IntrArgMemOnly]>;
3930 []>;
39173931
39183932 def int_x86_avx512_mask_scatterdiv2_di :
39193933 Intrinsic<[],
39203934 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
3921 [IntrArgMemOnly]>;
3935 []>;
39223936
39233937 def int_x86_avx512_mask_scatterdiv4_df :
39243938 Intrinsic<[],
39253939 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
3926 [IntrArgMemOnly]>;
3940 []>;
39273941
39283942 def int_x86_avx512_mask_scatterdiv4_di :
39293943 Intrinsic<[],
39303944 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
3931 [IntrArgMemOnly]>;
3945 []>;
39323946
39333947 def int_x86_avx512_mask_scatterdiv4_sf :
39343948 Intrinsic<[],
39353949 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
3936 [IntrArgMemOnly]>;
3950 []>;
39373951
39383952 def int_x86_avx512_mask_scatterdiv4_si :
39393953 Intrinsic<[],
39403954 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
3941 [IntrArgMemOnly]>;
3955 []>;
39423956
39433957 def int_x86_avx512_mask_scatterdiv8_sf :
39443958 Intrinsic<[],
39453959 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
3946 [IntrArgMemOnly]>;
3960 []>;
39473961
39483962 def int_x86_avx512_mask_scatterdiv8_si :
39493963 Intrinsic<[],
39503964 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
3951 [IntrArgMemOnly]>;
3965 []>;
39523966
39533967 def int_x86_avx512_mask_scattersiv2_df :
39543968 Intrinsic<[],
39553969 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
3956 [IntrArgMemOnly]>;
3970 []>;
39573971
39583972 def int_x86_avx512_mask_scattersiv2_di :
39593973 Intrinsic<[],
39603974 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
3961 [IntrArgMemOnly]>;
3975 []>;
39623976
39633977 def int_x86_avx512_mask_scattersiv4_df :
39643978 Intrinsic<[],
39653979 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
3966 [IntrArgMemOnly]>;
3980 []>;
39673981
39683982 def int_x86_avx512_mask_scattersiv4_di :
39693983 Intrinsic<[],
39703984 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
3971 [IntrArgMemOnly]>;
3985 []>;
39723986
39733987 def int_x86_avx512_mask_scattersiv4_sf :
39743988 Intrinsic<[],
39753989 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
3976 [IntrArgMemOnly]>;
3990 []>;
39773991
39783992 def int_x86_avx512_mask_scattersiv4_si :
39793993 Intrinsic<[],
39803994 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
3981 [IntrArgMemOnly]>;
3995 []>;
39823996
39833997 def int_x86_avx512_mask_scattersiv8_sf :
39843998 Intrinsic<[],
39853999 [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
3986 [IntrArgMemOnly]>;
4000 []>;
39874001
39884002 def int_x86_avx512_mask_scattersiv8_si :
39894003 Intrinsic<[],
39904004 [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
3991 [IntrArgMemOnly]>;
4005 []>;
39924006 }
39934007
39944008 // AVX-512 conflict detection instruction
55 define <4 x i32> @bar(<4 x i32> %arg, i32* %arg1) {
66 ; CHECK-LABEL: @bar(
77 ; CHECK-NEXT: bb:
8 ; CHECK-NEXT: store i32 5, i32* [[ARG1:%.*]]
89 ; CHECK-NEXT: [[TMP:%.*]] = tail call <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32> zeroinitializer, i8* null, <4 x i32> [[ARG:%.*]], <4 x i32> , i8 1)
9 ; CHECK-NEXT: store i32 10, i32* [[ARG1:%.*]]
10 ; CHECK-NEXT: store i32 10, i32* [[ARG1]]
1011 ; CHECK-NEXT: ret <4 x i32> [[TMP]]
1112 ;
1213 bb: