LLVM 24.0.0git
LoongArchMemoryBarrierOpt.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loongarch-memory-barrier-opt"
#define LOONGARCH_MEMORY_BARRIER_OPT_NAME    "LoongArch Memory Barrier Optimisation pass"
#define AMO_CASES
#define CASE(Name, Suffix)
#define CASE(Name, Suffix)

Functions

 INITIALIZE_PASS_BEGIN (LoongArchMemoryBarrierOpt, DEBUG_TYPE, LOONGARCH_MEMORY_BARRIER_OPT_NAME, false, false) INITIALIZE_PASS_END(LoongArchMemoryBarrierOpt

Variables

static cl::opt< boolRequireNoPathBypass ("loongarch-require-no-path-bypass", cl::desc("Optimize only when no paths bypass either memory barrier"), cl::init(true), cl::Hidden)
static cl::opt< boolMergeAMOWithMB ("loongarch-merge-amo-with-dbar", cl::desc("Merge AMOs with DBARs into AMO_DB during optimization"), cl::init(true), cl::Hidden)
static cl::opt< boolDisableInlineAsm ("loongarch-disable-inline-asm-barrier-opt", cl::desc("Disable optimization of memory barriers in InlineAsm"), cl::init(false), cl::Hidden)
static cl::opt< boolReplaceEliminatedMBToNop ("loongarch-replace-eliminated-dbar-to-nop", cl::desc("Replace eliminated DBARs with NOPs to preserve code layout"), cl::init(false), cl::Hidden)
 DEBUG_TYPE
 LOONGARCH_MEMORY_BARRIER_OPT_NAME
 false

Macro Definition Documentation

◆ AMO_CASES

#define AMO_CASES
Value:
CASE(AMSWAP, B) \
CASE(AMSWAP, H) \
CASE(AMSWAP, W) \
CASE(AMSWAP, D) \
CASE(AMADD, B) \
CASE(AMADD, H) \
CASE(AMADD, W) \
CASE(AMADD, D) \
CASE(AMAND, W) \
CASE(AMAND, D) \
CASE(AMOR, W) \
CASE(AMOR, D) \
CASE(AMXOR, W) \
CASE(AMXOR, D) \
CASE(AMMAX, W) \
CASE(AMMAX, D) \
CASE(AMMAX, WU) \
CASE(AMMAX, DU) \
CASE(AMMIN, W) \
CASE(AMMIN, D) \
CASE(AMMIN, WU) \
CASE(AMMIN, DU) \
CASE(AMCAS, B) \
CASE(AMCAS, H) \
CASE(AMCAS, W) \
CASE(AMCAS, D)
#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")
#define H(x, y, z)
Definition MD5.cpp:56

Definition at line 56 of file LoongArchMemoryBarrierOpt.cpp.

◆ CASE [1/2]

#define CASE ( Name,
Suffix )
Value:
.Case(#Name "." #Suffix, MergeAMOWithMB ? #Name "_DB." #Suffix : "") \
.Case(#Name "_DB." #Suffix, #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)

◆ CASE [2/2]

#define CASE ( Name,
Suffix )
Value:
case LoongArch::Name##_##Suffix: \
return std::nullopt; \
[[fallthrough]]; \
case LoongArch::Name##__DB_##Suffix: \
return LoongArch::Name##__DB_##Suffix;
#define _

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loongarch-memory-barrier-opt"

Definition at line 30 of file LoongArchMemoryBarrierOpt.cpp.

◆ LOONGARCH_MEMORY_BARRIER_OPT_NAME

#define LOONGARCH_MEMORY_BARRIER_OPT_NAME    "LoongArch Memory Barrier Optimisation pass"

Definition at line 31 of file LoongArchMemoryBarrierOpt.cpp.

Referenced by INITIALIZE_PASS_BEGIN().

Function Documentation

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( LoongArchMemoryBarrierOpt ,
DEBUG_TYPE ,
LOONGARCH_MEMORY_BARRIER_OPT_NAME ,
false ,
false  )

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 554 of file LoongArchMemoryBarrierOpt.cpp.

◆ DisableInlineAsm

cl::opt< bool > DisableInlineAsm("loongarch-disable-inline-asm-barrier-opt", cl::desc("Disable optimization of memory barriers in InlineAsm"), cl::init(false), cl::Hidden) ( "loongarch-disable-inline-asm-barrier-opt" ,
cl::desc("Disable optimization of memory barriers in InlineAsm") ,
cl::init(false) ,
cl::Hidden  )
static

◆ false

false

Definition at line 555 of file LoongArchMemoryBarrierOpt.cpp.

◆ LOONGARCH_MEMORY_BARRIER_OPT_NAME

LOONGARCH_MEMORY_BARRIER_OPT_NAME

Definition at line 555 of file LoongArchMemoryBarrierOpt.cpp.

◆ 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