Go to the documentation of this file.
23 #define DEBUG_TYPE "loweratomic"
43 if (
FenceInst *FI = dyn_cast<FenceInst>(&Inst))
47 else if (
AtomicRMWInst *RMWI = dyn_cast<AtomicRMWInst>(&Inst))
49 else if (
LoadInst *LI = dyn_cast<LoadInst>(&Inst)) {
52 }
else if (
StoreInst *
SI = dyn_cast<StoreInst>(&Inst)) {
86 auto PA = Impl.run(
F, DummyFAM);
87 return !PA.areAllPreserved();
97 "Lower atomic intrinsics to non-atomic form",
false,
false)
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
A pass that lowers atomic intrinsic into non-atomic intrinsics.
void initializeLowerAtomicLegacyPassPass(PassRegistry &)
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
An instruction for ordering other memory operations.
static bool LowerFenceInst(FenceInst *FI)
static bool LowerStoreInst(StoreInst *SI)
static bool lowerAtomics(Function &F)
LLVM Basic Block Representation.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
An instruction for storing to memory.
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
Pass * createLowerAtomicPass()
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
bool lowerAtomicRMWInst(AtomicRMWInst *RMWI)
Convert the given RMWI into primitive load and stores, assuming that doing so is legal.
StandardInstrumentations SI(Debug, VerifyEach)
bool lowerAtomicCmpXchgInst(AtomicCmpXchgInst *CXI)
Convert the given Cmpxchg into primitive load and compare.
static bool runOnBasicBlock(BasicBlock &BB)
void setAtomic(AtomicOrdering Ordering, SyncScope::ID SSID=SyncScope::System)
Sets the ordering constraint and the synchronization scope ID of this load instruction.
An instruction for reading from memory.
an instruction that atomically reads a memory location, combines it with another value,...
static bool runOnFunction(Function &F, bool PostInlining)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &)
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Pass interface - Implemented by all 'passes'.
INITIALIZE_PASS(LowerAtomicLegacyPass, "loweratomic", "Lower atomic intrinsics to non-atomic form", false, false) Pass *llvm
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
An instruction that atomically checks whether a specified value is in a memory location,...
static bool LowerLoadInst(LoadInst *LI)