LLVM 24.0.0git
LoongArchExpandAtomicPseudoInsts.cpp File Reference

Go to the source code of this file.

Macros

#define LoongArch_EXPAND_ATOMIC_PSEUDO_NAME    "LoongArch atomic pseudo instruction expansion pass"

Functions

static void doAtomicBinOpExpansion (const LoongArchInstrInfo *TII, MachineInstr &MI, DebugLoc DL, MachineBasicBlock *ThisMBB, MachineBasicBlock *LoopMBB, MachineBasicBlock *DoneMBB, AtomicRMWInst::BinOp BinOp, int Width)
static void insertMaskedMerge (const LoongArchInstrInfo *TII, DebugLoc DL, MachineBasicBlock *MBB, Register DestReg, Register OldValReg, Register NewValReg, Register MaskReg, Register ScratchReg)
static void doMaskedAtomicBinOpExpansion (const LoongArchInstrInfo *TII, MachineInstr &MI, DebugLoc DL, MachineBasicBlock *ThisMBB, MachineBasicBlock *LoopMBB, MachineBasicBlock *DoneMBB, AtomicRMWInst::BinOp BinOp, int Width)
static bool expandAtomicBinOp (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, AtomicRMWInst::BinOp BinOp, bool IsMasked, int Width, MachineBasicBlock::iterator &NextMBBI, const LoongArchInstrInfo *TII)
static void insertSext (const LoongArchInstrInfo *TII, DebugLoc DL, MachineBasicBlock *MBB, Register ValReg, Register ShamtReg)
static bool expandAtomicMinMaxOp (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, AtomicRMWInst::BinOp BinOp, bool IsMasked, int Width, MachineBasicBlock::iterator &NextMBBI, const LoongArchInstrInfo *TII)
static bool expandAtomicCmpXchg (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool IsMasked, int Width, MachineBasicBlock::iterator &NextMBBI, const LoongArchInstrInfo *TII)
static bool expandAtomicCmpXchg128 (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, MachineBasicBlock::iterator &NextMBBI, const LoongArchInstrInfo *TII)
static bool expandMI (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, MachineBasicBlock::iterator &NextMBBI, const LoongArchInstrInfo *TII)
static bool expandMBB (MachineBasicBlock &MBB, const LoongArchInstrInfo *TII)
static bool expandAtomicPseudo (MachineFunction &MF)
 INITIALIZE_PASS (LoongArchExpandAtomicPseudoLegacy, "loongarch-expand-atomic-pseudo", LoongArch_EXPAND_ATOMIC_PSEUDO_NAME, false, false) namespace llvm

Macro Definition Documentation

◆ LoongArch_EXPAND_ATOMIC_PSEUDO_NAME

#define LoongArch_EXPAND_ATOMIC_PSEUDO_NAME    "LoongArch atomic pseudo instruction expansion pass"

Definition at line 28 of file LoongArchExpandAtomicPseudoInsts.cpp.

Referenced by INITIALIZE_PASS().

Function Documentation

◆ doAtomicBinOpExpansion()

◆ doMaskedAtomicBinOpExpansion()

◆ expandAtomicBinOp()

◆ expandAtomicCmpXchg()

◆ expandAtomicCmpXchg128()

◆ expandAtomicMinMaxOp()

◆ expandAtomicPseudo()

◆ expandMBB()

bool expandMBB ( MachineBasicBlock & MBB,
const LoongArchInstrInfo * TII )
static

Definition at line 715 of file LoongArchExpandAtomicPseudoInsts.cpp.

References E(), expandMI(), MBB, MBBI, Modified, and TII.

Referenced by expandAtomicPseudo(), and expandPseudo().

◆ expandMI()

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( LoongArchExpandAtomicPseudoLegacy ,
"loongarch-expand-atomic-pseudo" ,
LoongArch_EXPAND_ATOMIC_PSEUDO_NAME ,
false ,
false  )

◆ insertMaskedMerge()

void insertMaskedMerge ( const LoongArchInstrInfo * TII,
DebugLoc DL,
MachineBasicBlock * MBB,
Register DestReg,
Register OldValReg,
Register NewValReg,
Register MaskReg,
Register ScratchReg )
static

◆ insertSext()

void insertSext ( const LoongArchInstrInfo * TII,
DebugLoc DL,
MachineBasicBlock * MBB,
Register ValReg,
Register ShamtReg )
static