Skip to content

Commit 58bf9ac

Browse files
authored
[NVPTX] Remove unsupported 'seq_cst' test (llvm#156088)
The NVPTX backend does not currently support correctly lowering `atomicrmw` with `seq_cst` of any size. Remove a test which erroneously hit this case and add logic to appropriately error out when this ordering is encountered, instead of emitting invalid PTX. In the long term, we should use `fence.sc`, similar to other atomic operations, to support this ordering.
1 parent 01c0a84 commit 58bf9ac

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ void NVPTXInstPrinter::printAtomicCode(const MCInst *MI, int OpNum,
290290
O << ".acq_rel";
291291
return;
292292
case NVPTX::Ordering::SequentiallyConsistent:
293-
O << ".seq_cst";
293+
report_fatal_error(
294+
"NVPTX AtomicCode Printer does not support \"seq_cst\" ordering.");
294295
return;
295296
case NVPTX::Ordering::Volatile:
296297
O << ".volatile";

llvm/test/CodeGen/NVPTX/atomics-b128.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,10 +1024,10 @@ define void @test_atomicrmw_xchg_const() {
10241024
; CHECK-NEXT: {
10251025
; CHECK-NEXT: .reg .b128 amt, dst;
10261026
; CHECK-NEXT: mov.b128 amt, {%rd2, %rd1};
1027-
; CHECK-NEXT: atom.seq_cst.sys.shared.exch.b128 dst, [si128], amt;
1027+
; CHECK-NEXT: atom.relaxed.sys.shared.exch.b128 dst, [si128], amt;
10281028
; CHECK-NEXT: mov.b128 {%rd3, %rd4}, dst;
10291029
; CHECK-NEXT: }
10301030
; CHECK-NEXT: ret;
1031-
%res = atomicrmw xchg ptr addrspace(3) @si128, i128 23 seq_cst
1031+
%res = atomicrmw xchg ptr addrspace(3) @si128, i128 23 monotonic
10321032
ret void
10331033
}

0 commit comments

Comments
 (0)