LLVM: lib/Transforms/Scalar/LowerAtomicPass.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

20using namespace llvm;

21

22#define DEBUG_TYPE "lower-atomic"

23

28

33

38

49 if (LI->isAtomic())

52 if (SI->isAtomic())

54 }

55 }

57}

58

66

72

73namespace {

74class LowerAtomicLegacyPass : public FunctionPass {

75public:

76 static char ID;

77

80 }

81

83

85 auto PA = Impl.run(F, DummyFAM);

86 return !PA.areAllPreserved();

87 }

88

89private:

90 LowerAtomicPass Impl;

91 };

92}

93

94char LowerAtomicLegacyPass::ID = 0;

96 "Lower atomic intrinsics to non-atomic form", false, false)

97

static bool runOnFunction(Function &F, bool PostInlining)

static bool LowerStoreInst(StoreInst *SI)

Definition LowerAtomicPass.cpp:34

static bool LowerLoadInst(LoadInst *LI)

Definition LowerAtomicPass.cpp:29

static bool LowerFenceInst(FenceInst *FI)

Definition LowerAtomicPass.cpp:24

static bool runOnBasicBlock(BasicBlock &BB)

Definition LowerAtomicPass.cpp:39

static bool lowerAtomics(Function &F)

Definition LowerAtomicPass.cpp:59

#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)

An instruction that atomically checks whether a specified value is in a memory location,...

an instruction that atomically reads a memory location, combines it with another value,...

LLVM Basic Block Representation.

An instruction for ordering other memory operations.

FunctionPass class - This class is used to implement most global optimizations.

LLVM_ABI InstListType::iterator eraseFromParent()

This method unlinks 'this' from the containing basic block and deletes it.

An instruction for reading from memory.

void setAtomic(AtomicOrdering Ordering, SyncScope::ID SSID=SyncScope::System)

Sets the ordering constraint and the synchronization scope ID of this load instruction.

PreservedAnalyses run(Function &F, FunctionAnalysisManager &)

Definition LowerAtomicPass.cpp:67

static LLVM_ABI PassRegistry * getPassRegistry()

getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...

Pass interface - Implemented by all 'passes'.

A set of analyses that are preserved following a run of a transformation pass.

static PreservedAnalyses none()

Convenience factory function for the empty preserved set.

static PreservedAnalyses all()

Construct a special preserved set that preserves all passes.

An instruction for storing to memory.

unsigned ID

LLVM IR allows to use arbitrary numbers as calling convention identifiers.

This is an optimization pass for GlobalISel generic memory operations.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

LLVM_ABI void initializeLowerAtomicLegacyPassPass(PassRegistry &)

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...

LLVM_ABI Pass * createLowerAtomicPass()

bool lowerAtomicCmpXchgInst(AtomicCmpXchgInst *CXI)

Convert the given Cmpxchg into primitive load and compare.

bool lowerAtomicRMWInst(AtomicRMWInst *RMWI)

Convert the given RMWI into primitive load and stores, assuming that doing so is legal.

AnalysisManager< Function > FunctionAnalysisManager

Convenience typedef for the Function analysis manager.