Index: clang/include/clang/Basic/BuiltinsNVPTX.def =================================================================== --- clang/include/clang/Basic/BuiltinsNVPTX.def +++ clang/include/clang/Basic/BuiltinsNVPTX.def @@ -465,28 +465,28 @@ BUILTIN(__nvvm_atom_add_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_add_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_add_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_i, "iiD*i", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_i, "iiD*i", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_i, "iiD*i", "n", "sm_60") BUILTIN(__nvvm_atom_add_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_add_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_add_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_l, "LiLiD*Li", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_l, "LiLiD*Li", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_l, "LiLiD*Li", "n", "sm_60") BUILTIN(__nvvm_atom_add_g_ll, "LLiLLiD*1LLi", "n") BUILTIN(__nvvm_atom_add_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_add_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_ll, "LLiLLiD*LLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_ll, "LLiLLiD*LLi", "n", "sm_60") BUILTIN(__nvvm_atom_add_g_f, "ffD*1f", "n") BUILTIN(__nvvm_atom_add_s_f, "ffD*3f", "n") BUILTIN(__nvvm_atom_add_gen_f, "ffD*f", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_f, "ffD*f", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_f, "ffD*f", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_f, "ffD*f", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_f, "ffD*f", "n", "sm_60") BUILTIN(__nvvm_atom_add_g_d, "ddD*1d", "n") BUILTIN(__nvvm_atom_add_s_d, "ddD*3d", "n") -TARGET_BUILTIN(__nvvm_atom_add_gen_d, "ddD*d", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_d, "ddD*d", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_d, "ddD*d", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_add_gen_d, "ddD*d", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_d, "ddD*d", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_d, "ddD*d", "n", "sm_60") BUILTIN(__nvvm_atom_sub_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_sub_s_i, "iiD*3i", "n") @@ -501,155 +501,155 @@ BUILTIN(__nvvm_atom_xchg_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_xchg_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_xchg_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_i, "iiD*i", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_i, "iiD*i", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_i, "iiD*i", "n", "sm_60") BUILTIN(__nvvm_atom_xchg_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_xchg_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_xchg_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_l, "LiLiD*Li", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_l, "LiLiD*Li", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_l, "LiLiD*Li", "n", "sm_60") BUILTIN(__nvvm_atom_xchg_g_ll, "LLiLLiD*1LLi", "n") BUILTIN(__nvvm_atom_xchg_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_xchg_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_ll, "LLiLLiD*LLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_ll, "LLiLLiD*LLi", "n", "sm_60") BUILTIN(__nvvm_atom_max_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_max_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_max_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_i, "iiD*i", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_i, "iiD*i", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_i, "iiD*i", "n", "sm_60") BUILTIN(__nvvm_atom_max_g_ui, "UiUiD*1Ui", "n") BUILTIN(__nvvm_atom_max_s_ui, "UiUiD*3Ui", "n") BUILTIN(__nvvm_atom_max_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ui, "UiUiD*Ui", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ui, "UiUiD*Ui", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ui, "UiUiD*Ui", "n", "sm_60") BUILTIN(__nvvm_atom_max_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_max_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_max_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_l, "LiLiD*Li", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_l, "LiLiD*Li", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_l, "LiLiD*Li", "n", "sm_60") BUILTIN(__nvvm_atom_max_g_ul, "ULiULiD*1ULi", "n") BUILTIN(__nvvm_atom_max_s_ul, "ULiULiD*3ULi", "n") BUILTIN(__nvvm_atom_max_gen_ul, "ULiULiD*ULi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ul, "ULiULiD*ULi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ul, "ULiULiD*ULi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ul, "ULiULiD*ULi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ul, "ULiULiD*ULi", "n", "sm_60") BUILTIN(__nvvm_atom_max_g_ll, "LLiLLiD*1LLi", "n") BUILTIN(__nvvm_atom_max_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_max_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ll, "LLiLLiD*LLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ll, "LLiLLiD*LLi", "n", "sm_60") BUILTIN(__nvvm_atom_max_g_ull, "ULLiULLiD*1ULLi", "n") BUILTIN(__nvvm_atom_max_s_ull, "ULLiULLiD*3ULLi", "n") BUILTIN(__nvvm_atom_max_gen_ull, "ULLiULLiD*ULLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ull, "ULLiULLiD*ULLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ull, "ULLiULLiD*ULLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ull, "ULLiULLiD*ULLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ull, "ULLiULLiD*ULLi", "n", "sm_60") BUILTIN(__nvvm_atom_min_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_min_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_min_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_i, "iiD*i", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_i, "iiD*i", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_i, "iiD*i", "n", "sm_60") BUILTIN(__nvvm_atom_min_g_ui, "UiUiD*1Ui", "n") BUILTIN(__nvvm_atom_min_s_ui, "UiUiD*3Ui", "n") BUILTIN(__nvvm_atom_min_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ui, "UiUiD*Ui", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ui, "UiUiD*Ui", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ui, "UiUiD*Ui", "n", "sm_60") BUILTIN(__nvvm_atom_min_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_min_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_min_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_l, "LiLiD*Li", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_l, "LiLiD*Li", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_l, "LiLiD*Li", "n", "sm_60") BUILTIN(__nvvm_atom_min_g_ul, "ULiULiD*1ULi", "n") BUILTIN(__nvvm_atom_min_s_ul, "ULiULiD*3ULi", "n") BUILTIN(__nvvm_atom_min_gen_ul, "ULiULiD*ULi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ul, "ULiULiD*ULi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ul, "ULiULiD*ULi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ul, "ULiULiD*ULi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ul, "ULiULiD*ULi", "n", "sm_60") BUILTIN(__nvvm_atom_min_g_ll, "LLiLLiD*1LLi", "n") BUILTIN(__nvvm_atom_min_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_min_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ll, "LLiLLiD*LLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ll, "LLiLLiD*LLi", "n", "sm_60") BUILTIN(__nvvm_atom_min_g_ull, "ULLiULLiD*1ULLi", "n") BUILTIN(__nvvm_atom_min_s_ull, "ULLiULLiD*3ULLi", "n") BUILTIN(__nvvm_atom_min_gen_ull, "ULLiULLiD*ULLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ull, "ULLiULLiD*ULLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ull, "ULLiULLiD*ULLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ull, "ULLiULLiD*ULLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ull, "ULLiULLiD*ULLi", "n", "sm_60") BUILTIN(__nvvm_atom_inc_g_ui, "UiUiD*1Ui", "n") BUILTIN(__nvvm_atom_inc_s_ui, "UiUiD*3Ui", "n") BUILTIN(__nvvm_atom_inc_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_inc_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_inc_gen_ui, "UiUiD*Ui", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_inc_gen_ui, "UiUiD*Ui", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_inc_gen_ui, "UiUiD*Ui", "n", "sm_60") BUILTIN(__nvvm_atom_dec_g_ui, "UiUiD*1Ui", "n") BUILTIN(__nvvm_atom_dec_s_ui, "UiUiD*3Ui", "n") BUILTIN(__nvvm_atom_dec_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_dec_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_dec_gen_ui, "UiUiD*Ui", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_dec_gen_ui, "UiUiD*Ui", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_dec_gen_ui, "UiUiD*Ui", "n", "sm_60") BUILTIN(__nvvm_atom_and_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_and_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_and_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_and_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_and_gen_i, "iiD*i", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_and_gen_i, "iiD*i", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_and_gen_i, "iiD*i", "n", "sm_60") BUILTIN(__nvvm_atom_and_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_and_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_and_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_and_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_and_gen_l, "LiLiD*Li", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_and_gen_l, "LiLiD*Li", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_and_gen_l, "LiLiD*Li", "n", "sm_60") BUILTIN(__nvvm_atom_and_g_ll, "LLiLLiD*1LLi", "n") BUILTIN(__nvvm_atom_and_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_and_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_and_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_and_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_and_gen_ll, "LLiLLiD*LLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_and_gen_ll, "LLiLLiD*LLi", "n", "sm_60") BUILTIN(__nvvm_atom_or_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_or_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_or_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_or_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_or_gen_i, "iiD*i", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_or_gen_i, "iiD*i", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_or_gen_i, "iiD*i", "n", "sm_60") BUILTIN(__nvvm_atom_or_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_or_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_or_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_or_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_or_gen_l, "LiLiD*Li", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_or_gen_l, "LiLiD*Li", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_or_gen_l, "LiLiD*Li", "n", "sm_60") BUILTIN(__nvvm_atom_or_g_ll, "LLiLLiD*1LLi", "n") BUILTIN(__nvvm_atom_or_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_or_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_or_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_or_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_or_gen_ll, "LLiLLiD*LLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_or_gen_ll, "LLiLLiD*LLi", "n", "sm_60") BUILTIN(__nvvm_atom_xor_g_i, "iiD*1i", "n") BUILTIN(__nvvm_atom_xor_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_xor_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_i, "iiD*i", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_i, "iiD*i", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_i, "iiD*i", "n", "sm_60") BUILTIN(__nvvm_atom_xor_g_l, "LiLiD*1Li", "n") BUILTIN(__nvvm_atom_xor_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_xor_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_l, "LiLiD*Li", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_l, "LiLiD*Li", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_l, "LiLiD*Li", "n", "sm_60") BUILTIN(__nvvm_atom_xor_g_ll, "LLiLLiD*1LLi", "n") BUILTIN(__nvvm_atom_xor_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_xor_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_ll, "LLiLLiD*LLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_ll, "LLiLLiD*LLi", "n", "sm_60") BUILTIN(__nvvm_atom_cas_g_i, "iiD*1ii", "n") BUILTIN(__nvvm_atom_cas_s_i, "iiD*3ii", "n") BUILTIN(__nvvm_atom_cas_gen_i, "iiD*ii", "n") -TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_i, "iiD*ii", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_i, "iiD*ii", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_i, "iiD*ii", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_i, "iiD*ii", "n", "sm_60") BUILTIN(__nvvm_atom_cas_g_l, "LiLiD*1LiLi", "n") BUILTIN(__nvvm_atom_cas_s_l, "LiLiD*3LiLi", "n") BUILTIN(__nvvm_atom_cas_gen_l, "LiLiD*LiLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_l, "LiLiD*LiLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_l, "LiLiD*LiLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_l, "LiLiD*LiLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_l, "LiLiD*LiLi", "n", "sm_60") BUILTIN(__nvvm_atom_cas_g_ll, "LLiLLiD*1LLiLLi", "n") BUILTIN(__nvvm_atom_cas_s_ll, "LLiLLiD*3LLiLLi", "n") BUILTIN(__nvvm_atom_cas_gen_ll, "LLiLLiD*LLiLLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_ll, "LLiLLiD*LLiLLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_ll, "LLiLLiD*LLiLLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_ll, "LLiLLiD*LLiLLi", "n", "sm_60") +TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_ll, "LLiLLiD*LLiLLi", "n", "sm_60") // Compiler Error Warn BUILTIN(__nvvm_compiler_error, "vcC*4", "n") Index: clang/include/clang/Basic/Cuda.h =================================================================== --- clang/include/clang/Basic/Cuda.h +++ clang/include/clang/Basic/Cuda.h @@ -10,6 +10,8 @@ #ifndef LLVM_CLANG_BASIC_CUDA_H #define LLVM_CLANG_BASIC_CUDA_H +#include + namespace llvm { class StringRef; } // namespace llvm @@ -50,6 +52,13 @@ }; const char *CudaArchToString(CudaArch A); +static inline const std::vector CudaKnownArchList() { + return {CudaArch::SM_20, CudaArch::SM_21, CudaArch::SM_30, CudaArch::SM_32, + CudaArch::SM_35, CudaArch::SM_37, CudaArch::SM_50, CudaArch::SM_52, + CudaArch::SM_53, CudaArch::SM_60, CudaArch::SM_61, CudaArch::SM_62, + CudaArch::SM_70, CudaArch::SM_72}; +} + // The input should have the form "sm_20". CudaArch StringToCudaArch(llvm::StringRef S); Index: clang/lib/Basic/Targets/NVPTX.h =================================================================== --- clang/lib/Basic/Targets/NVPTX.h +++ clang/lib/Basic/Targets/NVPTX.h @@ -40,6 +40,7 @@ static const char *const GCCRegNames[]; static const Builtin::Info BuiltinInfo[]; CudaArch GPU; + uint32_t PTXVersion; std::unique_ptr HostTarget; public: @@ -51,15 +52,9 @@ ArrayRef getTargetBuiltins() const override; - bool - initFeatureMap(llvm::StringMap &Features, DiagnosticsEngine &Diags, - StringRef CPU, - const std::vector &FeaturesVec) const override { - Features["satom"] = GPU >= CudaArch::SM_60; - return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec); - } - bool hasFeature(StringRef Feature) const override; + Optional hasRequiredFeature(const llvm::StringMap FeatureMap, + const StringRef ReqFeature) const override; ArrayRef getGCCRegNames() const override; Index: clang/lib/Basic/Targets/NVPTX.cpp =================================================================== --- clang/lib/Basic/Targets/NVPTX.cpp +++ clang/lib/Basic/Targets/NVPTX.cpp @@ -40,6 +40,22 @@ assert((TargetPointerWidth == 32 || TargetPointerWidth == 64) && "NVPTX only supports 32- and 64-bit modes."); + PTXVersion = 32; + for (const StringRef Feature : Opts.FeaturesAsWritten) { + if (!Feature.startswith("+ptx")) + continue; + PTXVersion = llvm::StringSwitch(Feature) + .Case("+ptx61", 61) + .Case("+ptx60", 60) + .Case("+ptx50", 50) + .Case("+ptx43", 43) + .Case("+ptx42", 42) + .Case("+ptx41", 41) + .Case("+ptx40", 40) + .Case("+ptx32", 32) + .Default(32); + } + TLSSupported = false; VLASupported = false; AddrSpaceMap = &NVPTXAddrSpaceMap; @@ -142,11 +158,36 @@ return llvm::makeArrayRef(GCCRegNames); } -bool NVPTXTargetInfo::hasFeature(StringRef Feature) const { - return llvm::StringSwitch(Feature) +static Optional hasFeatureEnabled(CudaArch GPU, uint32_t PTXVersion, + const StringRef Feature) { + // Handle known GPU names. + CudaArch Arch = StringToCudaArch(Feature); + if (Arch != CudaArch::UNKNOWN) + return GPU >= Arch; + + return llvm::StringSwitch>(Feature) .Cases("ptx", "nvptx", true) - .Case("satom", GPU >= CudaArch::SM_60) // Atomics w/ scope. - .Default(false); + .Case("ptx61", PTXVersion >= 61) + .Case("ptx60", PTXVersion >= 60) + .Case("ptx50", PTXVersion >= 50) + .Case("ptx43", PTXVersion >= 43) + .Case("ptx42", PTXVersion >= 42) + .Case("ptx41", PTXVersion >= 41) + .Case("ptx40", PTXVersion >= 40) + .Case("ptx32", PTXVersion >= 32) + .Default({}); +} + +Optional +NVPTXTargetInfo::hasRequiredFeature(const llvm::StringMap FeatureMap, + const StringRef ReqFeature) const { + return hasFeatureEnabled(GPU, PTXVersion, ReqFeature); +} + +bool NVPTXTargetInfo::hasFeature(StringRef Feature) const { + if (Optional F = hasFeatureEnabled(GPU, PTXVersion, Feature)) + return F.getValue(); + return false; } void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts, Index: clang/test/CodeGen/builtins-nvptx-ptx50.cu =================================================================== --- clang/test/CodeGen/builtins-nvptx-ptx50.cu +++ clang/test/CodeGen/builtins-nvptx-ptx50.cu @@ -18,6 +18,6 @@ // CHECK-LABEL: test_fn __device__ void test_fn(double d, double* double_ptr) { // CHECK: call double @llvm.nvvm.atomic.load.add.f64.p0f64 - // expected-error@+1 {{'__nvvm_atom_add_gen_d' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_add_gen_d' needs target feature sm_60}} __nvvm_atom_add_gen_d(double_ptr, d); } Index: clang/test/CodeGen/builtins-nvptx.c =================================================================== --- clang/test/CodeGen/builtins-nvptx.c +++ clang/test/CodeGen/builtins-nvptx.c @@ -292,245 +292,245 @@ #if ERROR_CHECK || __CUDA_ARCH__ >= 600 // CHECK: call i32 @llvm.nvvm.atomic.add.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_add_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_add_gen_i' needs target feature sm_60}} __nvvm_atom_cta_add_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.add.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.add.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_add_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_add_gen_l' needs target feature sm_60}} __nvvm_atom_cta_add_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.add.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_add_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_add_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_add_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.add.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_add_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_add_gen_i' needs target feature sm_60}} __nvvm_atom_sys_add_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.add.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.add.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_add_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_add_gen_l' needs target feature sm_60}} __nvvm_atom_sys_add_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.add.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_add_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_add_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_add_gen_ll(&sll, ll); // CHECK: call float @llvm.nvvm.atomic.add.gen.f.cta.f32.p0f32 - // expected-error@+1 {{'__nvvm_atom_cta_add_gen_f' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_add_gen_f' needs target feature sm_60}} __nvvm_atom_cta_add_gen_f(fp, f); // CHECK: call double @llvm.nvvm.atomic.add.gen.f.cta.f64.p0f64 - // expected-error@+1 {{'__nvvm_atom_cta_add_gen_d' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_add_gen_d' needs target feature sm_60}} __nvvm_atom_cta_add_gen_d(dfp, df); // CHECK: call float @llvm.nvvm.atomic.add.gen.f.sys.f32.p0f32 - // expected-error@+1 {{'__nvvm_atom_sys_add_gen_f' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_add_gen_f' needs target feature sm_60}} __nvvm_atom_sys_add_gen_f(fp, f); // CHECK: call double @llvm.nvvm.atomic.add.gen.f.sys.f64.p0f64 - // expected-error@+1 {{'__nvvm_atom_sys_add_gen_d' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_add_gen_d' needs target feature sm_60}} __nvvm_atom_sys_add_gen_d(dfp, df); // CHECK: call i32 @llvm.nvvm.atomic.exch.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_xchg_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_xchg_gen_i' needs target feature sm_60}} __nvvm_atom_cta_xchg_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.exch.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.exch.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_xchg_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_xchg_gen_l' needs target feature sm_60}} __nvvm_atom_cta_xchg_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.exch.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_xchg_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_xchg_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_xchg_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.exch.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_xchg_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_xchg_gen_i' needs target feature sm_60}} __nvvm_atom_sys_xchg_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.exch.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.exch.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_xchg_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_xchg_gen_l' needs target feature sm_60}} __nvvm_atom_sys_xchg_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.exch.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_xchg_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_xchg_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_xchg_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.max.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_max_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_max_gen_i' needs target feature sm_60}} __nvvm_atom_cta_max_gen_i(ip, i); // CHECK: call i32 @llvm.nvvm.atomic.max.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ui' needs target feature sm_60}} __nvvm_atom_cta_max_gen_ui((unsigned int *)ip, i); // LP32: call i32 @llvm.nvvm.atomic.max.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.max.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_max_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_max_gen_l' needs target feature sm_60}} __nvvm_atom_cta_max_gen_l(&dl, l); // LP32: call i32 @llvm.nvvm.atomic.max.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.max.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ul' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ul' needs target feature sm_60}} __nvvm_atom_cta_max_gen_ul((unsigned long *)lp, l); // CHECK: call i64 @llvm.nvvm.atomic.max.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_max_gen_ll(&sll, ll); // CHECK: call i64 @llvm.nvvm.atomic.max.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ull' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_max_gen_ull' needs target feature sm_60}} __nvvm_atom_cta_max_gen_ull((unsigned long long *)llp, ll); // CHECK: call i32 @llvm.nvvm.atomic.max.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_max_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_max_gen_i' needs target feature sm_60}} __nvvm_atom_sys_max_gen_i(ip, i); // CHECK: call i32 @llvm.nvvm.atomic.max.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ui' needs target feature sm_60}} __nvvm_atom_sys_max_gen_ui((unsigned int *)ip, i); // LP32: call i32 @llvm.nvvm.atomic.max.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.max.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_max_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_max_gen_l' needs target feature sm_60}} __nvvm_atom_sys_max_gen_l(&dl, l); // LP32: call i32 @llvm.nvvm.atomic.max.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.max.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ul' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ul' needs target feature sm_60}} __nvvm_atom_sys_max_gen_ul((unsigned long *)lp, l); // CHECK: call i64 @llvm.nvvm.atomic.max.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_max_gen_ll(&sll, ll); // CHECK: call i64 @llvm.nvvm.atomic.max.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ull' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_max_gen_ull' needs target feature sm_60}} __nvvm_atom_sys_max_gen_ull((unsigned long long *)llp, ll); // CHECK: call i32 @llvm.nvvm.atomic.min.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_min_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_min_gen_i' needs target feature sm_60}} __nvvm_atom_cta_min_gen_i(ip, i); // CHECK: call i32 @llvm.nvvm.atomic.min.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ui' needs target feature sm_60}} __nvvm_atom_cta_min_gen_ui((unsigned int *)ip, i); // LP32: call i32 @llvm.nvvm.atomic.min.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.min.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_min_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_min_gen_l' needs target feature sm_60}} __nvvm_atom_cta_min_gen_l(&dl, l); // LP32: call i32 @llvm.nvvm.atomic.min.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.min.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ul' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ul' needs target feature sm_60}} __nvvm_atom_cta_min_gen_ul((unsigned long *)lp, l); // CHECK: call i64 @llvm.nvvm.atomic.min.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_min_gen_ll(&sll, ll); // CHECK: call i64 @llvm.nvvm.atomic.min.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ull' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_min_gen_ull' needs target feature sm_60}} __nvvm_atom_cta_min_gen_ull((unsigned long long *)llp, ll); // CHECK: call i32 @llvm.nvvm.atomic.min.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_min_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_min_gen_i' needs target feature sm_60}} __nvvm_atom_sys_min_gen_i(ip, i); // CHECK: call i32 @llvm.nvvm.atomic.min.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ui' needs target feature sm_60}} __nvvm_atom_sys_min_gen_ui((unsigned int *)ip, i); // LP32: call i32 @llvm.nvvm.atomic.min.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.min.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_min_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_min_gen_l' needs target feature sm_60}} __nvvm_atom_sys_min_gen_l(&dl, l); // LP32: call i32 @llvm.nvvm.atomic.min.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.min.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ul' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ul' needs target feature sm_60}} __nvvm_atom_sys_min_gen_ul((unsigned long *)lp, l); // CHECK: call i64 @llvm.nvvm.atomic.min.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_min_gen_ll(&sll, ll); // CHECK: call i64 @llvm.nvvm.atomic.min.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ull' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_min_gen_ull' needs target feature sm_60}} __nvvm_atom_sys_min_gen_ull((unsigned long long *)llp, ll); // CHECK: call i32 @llvm.nvvm.atomic.inc.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_inc_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_inc_gen_ui' needs target feature sm_60}} __nvvm_atom_cta_inc_gen_ui((unsigned int *)ip, i); // CHECK: call i32 @llvm.nvvm.atomic.inc.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_inc_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_inc_gen_ui' needs target feature sm_60}} __nvvm_atom_sys_inc_gen_ui((unsigned int *)ip, i); // CHECK: call i32 @llvm.nvvm.atomic.dec.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_dec_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_dec_gen_ui' needs target feature sm_60}} __nvvm_atom_cta_dec_gen_ui((unsigned int *)ip, i); // CHECK: call i32 @llvm.nvvm.atomic.dec.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_dec_gen_ui' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_dec_gen_ui' needs target feature sm_60}} __nvvm_atom_sys_dec_gen_ui((unsigned int *)ip, i); // CHECK: call i32 @llvm.nvvm.atomic.and.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_and_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_and_gen_i' needs target feature sm_60}} __nvvm_atom_cta_and_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.and.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.and.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_and_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_and_gen_l' needs target feature sm_60}} __nvvm_atom_cta_and_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.and.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_and_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_and_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_and_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.and.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_and_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_and_gen_i' needs target feature sm_60}} __nvvm_atom_sys_and_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.and.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.and.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_and_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_and_gen_l' needs target feature sm_60}} __nvvm_atom_sys_and_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.and.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_and_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_and_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_and_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.or.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_or_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_or_gen_i' needs target feature sm_60}} __nvvm_atom_cta_or_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.or.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.or.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_or_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_or_gen_l' needs target feature sm_60}} __nvvm_atom_cta_or_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.or.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_or_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_or_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_or_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.or.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_or_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_or_gen_i' needs target feature sm_60}} __nvvm_atom_sys_or_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.or.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.or.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_or_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_or_gen_l' needs target feature sm_60}} __nvvm_atom_sys_or_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.or.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_or_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_or_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_or_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.xor.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_xor_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_xor_gen_i' needs target feature sm_60}} __nvvm_atom_cta_xor_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.xor.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.xor.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_xor_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_xor_gen_l' needs target feature sm_60}} __nvvm_atom_cta_xor_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.xor.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_xor_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_xor_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_xor_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.xor.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_xor_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_xor_gen_i' needs target feature sm_60}} __nvvm_atom_sys_xor_gen_i(ip, i); // LP32: call i32 @llvm.nvvm.atomic.xor.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.xor.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_xor_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_xor_gen_l' needs target feature sm_60}} __nvvm_atom_sys_xor_gen_l(&dl, l); // CHECK: call i64 @llvm.nvvm.atomic.xor.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_xor_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_xor_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_xor_gen_ll(&sll, ll); // CHECK: call i32 @llvm.nvvm.atomic.cas.gen.i.cta.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_cta_cas_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_cas_gen_i' needs target feature sm_60}} __nvvm_atom_cta_cas_gen_i(ip, i, 0); // LP32: call i32 @llvm.nvvm.atomic.cas.gen.i.cta.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.cas.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_cas_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_cas_gen_l' needs target feature sm_60}} __nvvm_atom_cta_cas_gen_l(&dl, l, 0); // CHECK: call i64 @llvm.nvvm.atomic.cas.gen.i.cta.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_cta_cas_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_cta_cas_gen_ll' needs target feature sm_60}} __nvvm_atom_cta_cas_gen_ll(&sll, ll, 0); // CHECK: call i32 @llvm.nvvm.atomic.cas.gen.i.sys.i32.p0i32 - // expected-error@+1 {{'__nvvm_atom_sys_cas_gen_i' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_cas_gen_i' needs target feature sm_60}} __nvvm_atom_sys_cas_gen_i(ip, i, 0); // LP32: call i32 @llvm.nvvm.atomic.cas.gen.i.sys.i32.p0i32 // LP64: call i64 @llvm.nvvm.atomic.cas.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_cas_gen_l' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_cas_gen_l' needs target feature sm_60}} __nvvm_atom_sys_cas_gen_l(&dl, l, 0); // CHECK: call i64 @llvm.nvvm.atomic.cas.gen.i.sys.i64.p0i64 - // expected-error@+1 {{'__nvvm_atom_sys_cas_gen_ll' needs target feature satom}} + // expected-error@+1 {{'__nvvm_atom_sys_cas_gen_ll' needs target feature sm_60}} __nvvm_atom_sys_cas_gen_ll(&sll, ll, 0); #endif Index: llvm/lib/Target/NVPTX/NVPTX.td =================================================================== --- llvm/lib/Target/NVPTX/NVPTX.td +++ llvm/lib/Target/NVPTX/NVPTX.td @@ -53,9 +53,6 @@ def SM70 : SubtargetFeature<"sm_70", "SmVersion", "70", "Target SM 7.0">; -def SATOM : SubtargetFeature<"satom", "HasAtomScope", "true", - "Atomic operations with scope">; - // PTX Versions def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32", "Use PTX version 3.2">; @@ -88,10 +85,10 @@ def : Proc<"sm_50", [SM50, PTX40]>; def : Proc<"sm_52", [SM52, PTX41]>; def : Proc<"sm_53", [SM53, PTX42]>; -def : Proc<"sm_60", [SM60, PTX50, SATOM]>; -def : Proc<"sm_61", [SM61, PTX50, SATOM]>; -def : Proc<"sm_62", [SM62, PTX50, SATOM]>; -def : Proc<"sm_70", [SM70, PTX60, SATOM]>; +def : Proc<"sm_60", [SM60, PTX50]>; +def : Proc<"sm_61", [SM61, PTX50]>; +def : Proc<"sm_62", [SM62, PTX50]>; +def : Proc<"sm_70", [SM70, PTX60]>; def NVPTXInstrInfo : InstrInfo { } Index: llvm/lib/Target/NVPTX/NVPTXSubtarget.h =================================================================== --- llvm/lib/Target/NVPTX/NVPTXSubtarget.h +++ llvm/lib/Target/NVPTX/NVPTXSubtarget.h @@ -48,10 +48,6 @@ // FrameLowering class because TargetFrameLowering is abstract. NVPTXFrameLowering FrameLowering; -protected: - // Processor supports scoped atomic operations. - bool HasAtomScope; - public: /// This constructor initializes the data members to match that /// of the specified module. @@ -74,7 +70,7 @@ } bool hasAtomAddF64() const { return SmVersion >= 60; } - bool hasAtomScope() const { return HasAtomScope; } + bool hasAtomScope() const { return SmVersion >= 60; } bool hasAtomBitwise64() const { return SmVersion >= 32; } bool hasAtomMinMax64() const { return SmVersion >= 32; } bool hasLDG() const { return SmVersion >= 32; }