Go to the source code of this file.
|
| static bool | checkAllPathSafe (const MachineBasicBlock *MBBA, const MachineBasicBlock *MBBB, bool IsAToB) |
| static unsigned | resolveBarrierRedundancy (const MachineInstr *A, const MachineInstr *B, const MachineDominatorTree *MDT, const MachinePostDominatorTree *MPDT) |
| static void | updateMB (InstBarrier &I, BarrierHint Hint) |
| static void | replaceAM (InstBarrier &I, MachineFunction &MF) |
| static bool | eliminateRedundantBarrier (InstBarrier &IA, InstBarrier &IB, MachineFunction &MF, const MachineDominatorTree *MDT, const MachinePostDominatorTree *MPDT) |
| static bool | runMemoryBarrierOpt (MachineFunction &MF, const MachineDominatorTree *MDT, const MachinePostDominatorTree *MPDT) |
| | INITIALIZE_PASS_BEGIN (LoongArchMemoryBarrierOptLegacy, DEBUG_TYPE, LOONGARCH_MEMORY_BARRIER_OPT_NAME, false, false) INITIALIZE_PASS_END(LoongArchMemoryBarrierOptLegacy |
◆ AMO_CASES
Value:
CASE(AMSWAP, W) \
CASE(AMADD, W) \
CASE(AMAND, W) \
CASE(AMOR, W) \
CASE(AMXOR, W) \
CASE(AMMAX, W) \
CASE(AMMAX, WU) \
CASE(AMMAX, DU) \
CASE(AMMIN, W) \
CASE(AMMIN, WU) \
CASE(AMMIN, DU) \
CASE(AMCAS, W) \
#define CASE(ATTRNAME, AANAME,...)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Definition at line 53 of file LoongArchMemoryBarrierOpt.cpp.
◆ CASE
| #define CASE |
( |
| Name, |
|
|
| Suffix ) |
Value: case LoongArch::Name##
_##Suffix: \
return std::nullopt; \
[[fallthrough]]; \
case LoongArch::Name##__DB_##Suffix: \
return LoongArch::Name##__DB_##Suffix;
static cl::opt< bool > MergeAMOWithMB("loongarch-merge-amo-with-dbar", cl::desc("Merge AMOs with DBARs into AMO_DB during optimization"), cl::init(true), cl::Hidden)
◆ DEBUG_TYPE
| #define DEBUG_TYPE "loongarch-memory-barrier-opt" |
◆ LOONGARCH_MEMORY_BARRIER_OPT_NAME
| #define LOONGARCH_MEMORY_BARRIER_OPT_NAME "LoongArch Memory Barrier Optimisation pass" |
◆ checkAllPathSafe()
Definition at line 209 of file LoongArchMemoryBarrierOpt.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::End, llvm::detail::DenseSetImpl< ValueT, MapTy >::insert(), MI, llvm::SmallVectorImpl< T >::pop_back_val(), Pred, llvm::MachineBasicBlock::predecessors(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::MachineBasicBlock::successors().
Referenced by resolveBarrierRedundancy().
◆ eliminateRedundantBarrier()
Definition at line 314 of file LoongArchMemoryBarrierOpt.cpp.
References A(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), B(), llvm::BuildMI(), llvm::MachineFunction::getSubtarget(), MI, replaceAM(), ReplaceEliminatedMBToNop, RequireNoPathBypass, resolveBarrierRedundancy(), and updateMB().
Referenced by runMemoryBarrierOpt().
◆ INITIALIZE_PASS_BEGIN()
◆ replaceAM()
◆ resolveBarrierRedundancy()
◆ runMemoryBarrierOpt()
◆ updateMB()
| void updateMB |
( |
InstBarrier & | I, |
|
|
BarrierHint | Hint ) |
|
static |
◆ DEBUG_TYPE
◆ false
◆ LOONGARCH_MEMORY_BARRIER_OPT_NAME
| LOONGARCH_MEMORY_BARRIER_OPT_NAME |
◆ MergeAMOWithMB
| cl::opt< bool > MergeAMOWithMB("loongarch-merge-amo-with-dbar", cl::desc("Merge AMOs with DBARs into AMO_DB during optimization"), cl::init(true), cl::Hidden) |
( |
"loongarch-merge-amo-with-dbar" | , |
|
|
cl::desc("Merge AMOs with DBARs into AMO_DB during optimization") | , |
|
|
cl::init(true) | , |
|
|
cl::Hidden | ) |
|
static |
◆ ReplaceEliminatedMBToNop
| cl::opt< bool > ReplaceEliminatedMBToNop("loongarch-replace-eliminated-dbar-to-nop", cl::desc("Replace eliminated DBARs with NOPs to preserve code layout"), cl::init(false), cl::Hidden) |
( |
"loongarch-replace-eliminated-dbar-to-nop" | , |
|
|
cl::desc("Replace eliminated DBARs with NOPs to preserve code layout") | , |
|
|
cl::init(false) | , |
|
|
cl::Hidden | ) |
|
static |
◆ RequireNoPathBypass
| cl::opt< bool > RequireNoPathBypass("loongarch-require-no-path-bypass", cl::desc("Optimize only when no paths bypass either memory barrier"), cl::init(true), cl::Hidden) |
( |
"loongarch-require-no-path-bypass" | , |
|
|
cl::desc("Optimize only when no paths bypass either memory barrier") | , |
|
|
cl::init(true) | , |
|
|
cl::Hidden | ) |
|
static |