[all-commits] [llvm/llvm-project] 0f1b16: [NVPTX] Add syncscope support for cmpxchg (#140812)

Akshay Deodhar via All-commits all-commits at lists.llvm.org
Tue Jul 15 17:09:14 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f1b16dd5f83fd931ecb111bb925ac9e1d56f589
      https://github.com/llvm/llvm-project/commit/0f1b16dd5f83fd931ecb111bb925ac9e1d56f589
  Author: Akshay Deodhar <adeodhar at nvidia.com>
  Date:   2025-07-15 (Tue, 15 Jul 2025)

  Changed paths:
    M llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp
    M llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.h
    M llvm/lib/Target/NVPTX/NVPTX.h
    M llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
    M llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h
    M llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
    M llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
    M llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
    M llvm/lib/Target/NVPTX/NVPTXUtilities.h
    M llvm/test/CodeGen/NVPTX/atomicrmw-expand.ll
    M llvm/test/CodeGen/NVPTX/atomics-sm70.ll
    M llvm/test/CodeGen/NVPTX/atomics-sm90.ll
    M llvm/test/CodeGen/NVPTX/cmpxchg-sm60.ll
    M llvm/test/CodeGen/NVPTX/cmpxchg-sm70.ll
    M llvm/test/CodeGen/NVPTX/cmpxchg-sm90.ll
    M llvm/test/CodeGen/NVPTX/cmpxchg.ll
    M llvm/test/CodeGen/NVPTX/cmpxchg.py
    M llvm/test/CodeGen/NVPTX/distributed-shared-cluster.ll

  Log Message:
  -----------
  [NVPTX] Add syncscope support for cmpxchg (#140812)

This MR adds support for cmpxchg instructions with syncscope.

- Adds a new definition for atomic 3-operand instructions, with constant
operands for sem, scope and addsp.
- Lowers cmpxchg SDNodes populating sem, scope and addsp using
SDNodeXForms.
- Handle syncscope correctly for emulation loops in AtomicExpand, in
bracketInstructionWithFences.
- Modifies emitLeadingFence, emitTrailingFence to accept SyncScope as a
parameter. Modifies implementation of these in other backends, with the
parameter being ignored.
- Tests for a _slice_ of all possible combinations of the cmpxchg
instruction (with modifications to cmpxchg.py)

---------

Co-authored-by: gonzalobg <65027571+gonzalobg at users.noreply.github.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list