Skip to content

Commit 87206dc

Browse files
committed
reverset the order of semantics and scope
1 parent a3d1782 commit 87206dc

File tree

6 files changed

+6096
-6071
lines changed

6 files changed

+6096
-6071
lines changed

clang/include/clang/Basic/BuiltinsNVPTX.def

Lines changed: 684 additions & 684 deletions
Large diffs are not rendered by default.

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 918 additions & 918 deletions
Large diffs are not rendered by default.

clang/test/CodeGen/builtins-nvptx.c

Lines changed: 1585 additions & 1560 deletions
Large diffs are not rendered by default.

llvm/include/llvm/IR/IntrinsicsNVVM.td

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,70 +1223,70 @@ let TargetPrefix = "nvvm" in {
12231223
LLVMMatchType<0>],
12241224
[IntrArgMemOnly, NoCapture<ArgIndex<0>>]>;
12251225

1226-
multiclass PTXAtomicWithScope2_sem<LLVMType elty> {
1227-
def "": SCOPED_ATOMIC2_impl<elty>;
1228-
def _acquire: SCOPED_ATOMIC2_impl<elty>;
1229-
def _release: SCOPED_ATOMIC2_impl<elty>;
1230-
def _acq_rel: SCOPED_ATOMIC2_impl<elty>;
1231-
}
1232-
multiclass PTXAtomicWithScope3_sem<LLVMType elty> {
1233-
def "": SCOPED_ATOMIC3_impl<elty>;
1234-
def _acquire: SCOPED_ATOMIC3_impl<elty>;
1235-
def _release: SCOPED_ATOMIC3_impl<elty>;
1236-
def _acq_rel: SCOPED_ATOMIC3_impl<elty>;
1237-
}
12381226
multiclass PTXAtomicWithScope2<LLVMType elty> {
1239-
defm "" : PTXAtomicWithScope2_sem<elty>;
1240-
defm _cta : PTXAtomicWithScope2_sem<elty>;
1241-
defm _sys : PTXAtomicWithScope2_sem<elty>;
1227+
def "" : SCOPED_ATOMIC2_impl<elty>;
1228+
def _cta : SCOPED_ATOMIC2_impl<elty>;
1229+
def _sys : SCOPED_ATOMIC2_impl<elty>;
12421230
}
12431231
multiclass PTXAtomicWithScope3<LLVMType elty> {
1244-
defm "" : PTXAtomicWithScope3_sem<elty>;
1245-
defm _cta : PTXAtomicWithScope3_sem<elty>;
1246-
defm _sys : PTXAtomicWithScope3_sem<elty>;
1232+
def "" : SCOPED_ATOMIC3_impl<elty>;
1233+
def _cta : SCOPED_ATOMIC3_impl<elty>;
1234+
def _sys : SCOPED_ATOMIC3_impl<elty>;
1235+
}
1236+
multiclass PTXAtomicWithScope2_sem<LLVMType elty> {
1237+
defm "": PTXAtomicWithScope2<elty>;
1238+
defm _acquire: PTXAtomicWithScope2<elty>;
1239+
defm _release: PTXAtomicWithScope2<elty>;
1240+
defm _acq_rel: PTXAtomicWithScope2<elty>;
1241+
}
1242+
multiclass PTXAtomicWithScope3_sem<LLVMType elty> {
1243+
defm "": PTXAtomicWithScope3<elty>;
1244+
defm _acquire: PTXAtomicWithScope3<elty>;
1245+
defm _release: PTXAtomicWithScope3<elty>;
1246+
defm _acq_rel: PTXAtomicWithScope3<elty>;
12471247
}
12481248
multiclass PTXAtomicWithScope2_fi {
1249-
defm _f: PTXAtomicWithScope2<llvm_anyfloat_ty>;
1250-
defm _i: PTXAtomicWithScope2<llvm_anyint_ty>;
1249+
defm _f: PTXAtomicWithScope2_sem<llvm_anyfloat_ty>;
1250+
defm _i: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
12511251
}
12521252
defm int_nvvm_atomic_add_gen : PTXAtomicWithScope2_fi;
1253-
defm int_nvvm_atomic_inc_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1254-
defm int_nvvm_atomic_dec_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1255-
defm int_nvvm_atomic_exch_gen_i: PTXAtomicWithScope2<llvm_anyint_ty>;
1256-
defm int_nvvm_atomic_xor_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1257-
defm int_nvvm_atomic_max_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1258-
defm int_nvvm_atomic_max_gen_ui: PTXAtomicWithScope2<llvm_anyint_ty>;
1259-
defm int_nvvm_atomic_min_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1260-
defm int_nvvm_atomic_min_gen_ui: PTXAtomicWithScope2<llvm_anyint_ty>;
1261-
defm int_nvvm_atomic_or_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1262-
defm int_nvvm_atomic_and_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1263-
defm int_nvvm_atomic_cas_gen_i : PTXAtomicWithScope3<llvm_anyint_ty>;
1253+
defm int_nvvm_atomic_inc_gen_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1254+
defm int_nvvm_atomic_dec_gen_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1255+
defm int_nvvm_atomic_exch_gen_i: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1256+
defm int_nvvm_atomic_xor_gen_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1257+
defm int_nvvm_atomic_max_gen_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1258+
defm int_nvvm_atomic_max_gen_ui: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1259+
defm int_nvvm_atomic_min_gen_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1260+
defm int_nvvm_atomic_min_gen_ui: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1261+
defm int_nvvm_atomic_or_gen_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1262+
defm int_nvvm_atomic_and_gen_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1263+
defm int_nvvm_atomic_cas_gen_i : PTXAtomicWithScope3_sem<llvm_anyint_ty>;
12641264

12651265
defm int_nvvm_atomic_add_shared : PTXAtomicWithScope2_fi;
1266-
defm int_nvvm_atomic_inc_shared_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1267-
defm int_nvvm_atomic_dec_shared_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1268-
defm int_nvvm_atomic_exch_shared_i: PTXAtomicWithScope2<llvm_anyint_ty>;
1269-
defm int_nvvm_atomic_xor_shared_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1270-
defm int_nvvm_atomic_max_shared_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1271-
defm int_nvvm_atomic_max_shared_ui: PTXAtomicWithScope2<llvm_anyint_ty>;
1272-
defm int_nvvm_atomic_min_shared_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1273-
defm int_nvvm_atomic_min_shared_ui: PTXAtomicWithScope2<llvm_anyint_ty>;
1274-
defm int_nvvm_atomic_or_shared_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1275-
defm int_nvvm_atomic_and_shared_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1276-
defm int_nvvm_atomic_cas_shared_i : PTXAtomicWithScope3<llvm_anyint_ty>;
1266+
defm int_nvvm_atomic_inc_shared_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1267+
defm int_nvvm_atomic_dec_shared_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1268+
defm int_nvvm_atomic_exch_shared_i: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1269+
defm int_nvvm_atomic_xor_shared_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1270+
defm int_nvvm_atomic_max_shared_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1271+
defm int_nvvm_atomic_max_shared_ui: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1272+
defm int_nvvm_atomic_min_shared_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1273+
defm int_nvvm_atomic_min_shared_ui: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1274+
defm int_nvvm_atomic_or_shared_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1275+
defm int_nvvm_atomic_and_shared_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1276+
defm int_nvvm_atomic_cas_shared_i : PTXAtomicWithScope3_sem<llvm_anyint_ty>;
12771277

12781278
defm int_nvvm_atomic_add_global : PTXAtomicWithScope2_fi;
1279-
defm int_nvvm_atomic_inc_global_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1280-
defm int_nvvm_atomic_dec_global_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1281-
defm int_nvvm_atomic_exch_global_i: PTXAtomicWithScope2<llvm_anyint_ty>;
1282-
defm int_nvvm_atomic_xor_global_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1283-
defm int_nvvm_atomic_max_global_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1284-
defm int_nvvm_atomic_max_global_ui: PTXAtomicWithScope2<llvm_anyint_ty>;
1285-
defm int_nvvm_atomic_min_global_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1286-
defm int_nvvm_atomic_min_global_ui: PTXAtomicWithScope2<llvm_anyint_ty>;
1287-
defm int_nvvm_atomic_or_global_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1288-
defm int_nvvm_atomic_and_global_i : PTXAtomicWithScope2<llvm_anyint_ty>;
1289-
defm int_nvvm_atomic_cas_global_i : PTXAtomicWithScope3<llvm_anyint_ty>;
1279+
defm int_nvvm_atomic_inc_global_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1280+
defm int_nvvm_atomic_dec_global_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1281+
defm int_nvvm_atomic_exch_global_i: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1282+
defm int_nvvm_atomic_xor_global_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1283+
defm int_nvvm_atomic_max_global_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1284+
defm int_nvvm_atomic_max_global_ui: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1285+
defm int_nvvm_atomic_min_global_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1286+
defm int_nvvm_atomic_min_global_ui: PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1287+
defm int_nvvm_atomic_or_global_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1288+
defm int_nvvm_atomic_and_global_i : PTXAtomicWithScope2_sem<llvm_anyint_ty>;
1289+
defm int_nvvm_atomic_cas_global_i : PTXAtomicWithScope3_sem<llvm_anyint_ty>;
12901290

12911291
// Bar.Sync
12921292

llvm/lib/Target/NVPTX/NVPTXIntrinsics.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,8 +1769,8 @@ multiclass ATOM2N_impl<string OpStr, string IntTypeStr, string TypeStr,
17691769
!cast<Intrinsic>(
17701770
"int_nvvm_atomic_" # OpStr
17711771
# "_" # SpaceStr # "_" # IntTypeStr
1772-
# !if(!eq(ScopeStr, "gpu"), "", "_" # ScopeStr)
1773-
# !if(!eq(SemStr, "relaxed"), "", "_" # SemStr)),
1772+
# !if(!eq(SemStr, "relaxed"), "", "_" # SemStr)
1773+
# !if(!eq(ScopeStr, "gpu"), "", "_" # ScopeStr)),
17741774
regclass, ImmType, Imm, ImmTy, Preds>;
17751775
}
17761776
multiclass ATOM3N_impl<string OpStr, string IntTypeStr, string TypeStr,
@@ -1785,8 +1785,8 @@ multiclass ATOM3N_impl<string OpStr, string IntTypeStr, string TypeStr,
17851785
!cast<Intrinsic>(
17861786
"int_nvvm_atomic_" # OpStr
17871787
# "_" # SpaceStr # "_" # IntTypeStr
1788-
# !if(!eq(ScopeStr, "gpu"), "", "_" # ScopeStr)
1789-
# !if(!eq(SemStr, "relaxed"), "", "_" # SemStr)),
1788+
# !if(!eq(SemStr, "relaxed"), "", "_" # SemStr)
1789+
# !if(!eq(ScopeStr, "gpu"), "", "_" # ScopeStr)),
17901790
regclass, ImmType, Imm, ImmTy, Preds>;
17911791
}
17921792

0 commit comments

Comments
 (0)