@@ -1882,22 +1882,22 @@ multiclass F_ATOMIC_2<RegTyInfo t, string sem_str, string as_str, string op_str,
18821882}
18831883
18841884multiclass F_ATOMIC_3<RegTyInfo t, string op_str> {
1885- defvar asm_str = "atom${sem:sem}${scope:scope}${addsp:addsp}" # op_str
1885+ defvar asm_str = "atom${sem:sem}${scope:scope}${addsp:addsp}" # op_str # "\t$dst, [$addr], $b, $c;";
18861886
18871887 let mayLoad = 1, mayStore = 1, hasSideEffects = 1 in {
1888- def _rr : BasicNVPTXInst <(outs t.RC:$dst),
1888+ def _rr : NVPTXInst <(outs t.RC:$dst),
18891889 (ins ADDR:$addr, t.RC:$b, t.RC:$c, AtomicCode:$sem, AtomicCode:$scope, AtomicCode:$addsp),
18901890 asm_str, []>;
18911891
1892- def _ir : BasicNVPTXInst <(outs t.RC:$dst),
1892+ def _ir : NVPTXInst <(outs t.RC:$dst),
18931893 (ins ADDR:$addr, t.Imm:$b, t.RC:$c, AtomicCode:$sem, AtomicCode:$scope, AtomicCode:$addsp),
18941894 asm_str, []>;
18951895
1896- def _ri : BasicNVPTXInst <(outs t.RC:$dst),
1896+ def _ri : NVPTXInst <(outs t.RC:$dst),
18971897 (ins ADDR:$addr, t.RC:$b, t.Imm:$c, AtomicCode:$sem, AtomicCode:$scope, AtomicCode:$addsp),
18981898 asm_str, []>;
18991899
1900- def _ii : BasicNVPTXInst <(outs t.RC:$dst),
1900+ def _ii : NVPTXInst <(outs t.RC:$dst),
19011901 (ins ADDR:$addr, t.Imm:$b, t.Imm:$c, AtomicCode:$sem, AtomicCode:$scope, AtomicCode:$addsp),
19021902 asm_str, []>;
19031903 }
@@ -2030,10 +2030,6 @@ multiclass ATOM2S_impl<string OpStr, string IntTypeStr, string TypeStr,
20302030multiclass F_ATOMIC_3_INTRINSIC_PATTERN<RegTyInfo t, string OpStr, string InstructionName, string IntTypeStr> {
20312031 foreach scope = ["cta", "sys"] in {
20322032 foreach space = ["gen"] in {
2033- <<<<<<< HEAD
2034- defm _#scope#space : ATOM3N_impl<OpStr, IntTypeStr, TypeStr, scope, space,
2035- t, !listconcat(Preds, [hasAtomScope])>;
2036- =======
20372033 defvar intrinsic = !cast<SDPatternOperator>("int_nvvm_atomic_" # OpStr # "_" # space # "_" # IntTypeStr # "_" # scope);
20382034 def : Pat<(t.Ty (intrinsic addr:$addr, t.Ty:$b, t.Ty:$c)),
20392035 (!cast<Instruction>(InstructionName # "_rr") ADDR:$addr, t.Ty:$b, t.Ty:$c, Ordering_not_atomic, !cast<PatLeaf>("Scope_" # scope), !cast<PatLeaf>("AddrSpace_" # space))>;
@@ -2046,7 +2042,6 @@ multiclass F_ATOMIC_3_INTRINSIC_PATTERN<RegTyInfo t, string OpStr, string Instru
20462042
20472043 def : Pat<(t.Ty (intrinsic addr:$addr, (t.Ty t.ImmNode:$b), (t.Ty t.ImmNode:$c))),
20482044 (!cast<Instruction>(InstructionName # "_ii") ADDR:$addr, (t.Ty t.ImmNode:$b), (t.Ty t.ImmNode:$c), Ordering_not_atomic, !cast<PatLeaf>("Scope_" # scope), !cast<PatLeaf>("AddrSpace_" # space))>;
2049- >>>>>>> Replace old F_ATOMIC_3 completely with a single-opcode variation
20502045 }
20512046 }
20522047}
@@ -2157,7 +2152,7 @@ def LDU_GLOBAL_v4i32 : VLDU_G_ELE_V4<"b32", B32>;
21572152// during the lifetime of the kernel.
21582153
21592154class LDG_G<NVPTXRegClass regclass>
2160- : NVPTXInst<(outs regclass:$result), (ins LdStCode :$Sign, i32imm:$fromWidth, ADDR:$src),
2155+ : NVPTXInst<(outs regclass:$result), (ins AtomicCode :$Sign, i32imm:$fromWidth, ADDR:$src),
21612156 "ld.global.nc.${Sign:sign}$fromWidth \t$result, [$src];", []>;
21622157
21632158def LD_GLOBAL_NC_i8 : LDG_G<B16>;
@@ -2170,19 +2165,19 @@ def LD_GLOBAL_NC_i64 : LDG_G<B64>;
21702165// Elementized vector ldg
21712166class VLDG_G_ELE_V2<NVPTXRegClass regclass> :
21722167 NVPTXInst<(outs regclass:$dst1, regclass:$dst2),
2173- (ins LdStCode :$Sign, i32imm:$fromWidth, ADDR:$src),
2168+ (ins AtomicCode :$Sign, i32imm:$fromWidth, ADDR:$src),
21742169 "ld.global.nc.v2.${Sign:sign}$fromWidth \t{{$dst1, $dst2}}, [$src];", []>;
21752170
21762171
21772172class VLDG_G_ELE_V4<NVPTXRegClass regclass> :
21782173 NVPTXInst<(outs regclass:$dst1, regclass:$dst2, regclass:$dst3, regclass:$dst4),
2179- (ins LdStCode :$Sign, i32imm:$fromWidth, ADDR:$src),
2174+ (ins AtomicCode :$Sign, i32imm:$fromWidth, ADDR:$src),
21802175 "ld.global.nc.v4.${Sign:sign}$fromWidth \t{{$dst1, $dst2, $dst3, $dst4}}, [$src];", []>;
21812176
21822177class VLDG_G_ELE_V8<NVPTXRegClass regclass> :
21832178 NVPTXInst<(outs regclass:$dst1, regclass:$dst2, regclass:$dst3, regclass:$dst4,
21842179 regclass:$dst5, regclass:$dst6, regclass:$dst7, regclass:$dst8),
2185- (ins LdStCode :$Sign, i32imm:$fromWidth, ADDR:$src),
2180+ (ins AtomicCode :$Sign, i32imm:$fromWidth, ADDR:$src),
21862181 "ld.global.nc.v8.${Sign:sign}$fromWidth \t{{$dst1, $dst2, $dst3, $dst4, $dst5, $dst6, $dst7, $dst8}}, [$src];", []>;
21872182
21882183// FIXME: 8-bit LDG should be fixed once LDG/LDU nodes are made into proper loads.
0 commit comments