LLVM: include/llvm/Transforms/Coroutines/CoroShape.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12#ifndef LLVM_TRANSFORMS_COROUTINES_COROSHAPE_H

13#define LLVM_TRANSFORMS_COROUTINES_COROSHAPE_H

14

18

19namespace llvm {

20

21class CallGraph;

22

23namespace coro {

24

26

27

28

29

31

32

33

34

36

37

38

39

40

41

43

44

45

46

48};

49

50

51

60

61

63

72

74

78 }

79

80

83

86

88

91

92

94 enum {

97

98

99

100

101

102

103

105 };

106

108

114

124 };

125

132 };

133

143

145 };

146

147 union {

151 };

152

156 }

157

160 return cast(CoroBegin->getId());

161 }

162

166 }

167

172 }

177 }

180 }

181

186 }

187

189 switch (ABI) {

193 false);

198

199 return nullptr;

200 }

201

203 }

204

208

209

210 if (auto STy = dyn_cast(FTy->getReturnType())) {

211 return STy->elements().slice(1);

212 } else {

214 }

215 }

216

219

220

222 return FTy->params().slice(1);

223 }

224

226 switch (ABI) {

229

235 }

237 }

238

242 return nullptr;

243 }

244

246 if (auto *I = dyn_cast(FramePtr)) {

248 It.setHeadBit(true);

249 return It;

250 }

251 return cast(FramePtr)->getParent()->getEntryBlock().begin();

252 }

253

254

255

256

258

259

260

261

263

268

269 analyze(F, CoroFrames, UnusedCoroSaves);

272 return;

273 }

275 }

276};

277

278}

279

280}

281

282#endif

This header defines various interfaces for pass management in LLVM.

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

an instruction to allocate memory on the stack

This represents either the llvm.coro.id.retcon or llvm.coro.id.retcon.once instruction.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

LLVM Basic Block Representation.

InstListType::iterator iterator

Instruction iterators...

The basic data container for the call graph of a Module of IR.

This is the shared class of boolean and integer constants.

This class represents the llvm.coro.begin or llvm.coro.begin.custom.abi instructions.

AnyCoroIdInst * getId() const

This represents the llvm.coro.id.async instruction.

This represents the llvm.coro.id instruction.

Class to represent function types.

ArrayRef< Type * > params() const

static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)

This static method is the primary way of constructing a FunctionType.

FunctionType * getFunctionType() const

Returns the FunctionType for me.

CallingConv::ID getCallingConv() const

getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...

This provides a uniform API for creating instructions and inserting them into a basic block: either a...

const Function * getFunction() const

Return the function this instruction belongs to.

Class to represent integer types.

Class to represent pointers.

static PointerType * getUnqual(Type *ElementType)

This constructs a pointer to an object of the specified type in the default address space (address sp...

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

Class to represent struct types.

Type * getElementType(unsigned N) const

static Type * getVoidTy(LLVMContext &C)

LLVMContext & getContext() const

Return the LLVMContext in which this type was uniqued.

LLVM Value Representation.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

@ Fast

Attempts to make calls as fast as possible (e.g.

@ Async

The "async continuation" lowering, where each suspend point creates a single continuation function.

@ RetconOnce

The "unique returned-continuation" lowering, where each suspend point creates a single continuation f...

@ Retcon

The "returned-continuation" lowering, where each suspend point creates a single continuation function...

@ Switch

The "resume-switch" lowering, where there are separate resume and destroy functions that are shared b...

This is an optimization pass for GlobalISel generic memory operations.

This struct is a compact representation of a valid (non-zero power of two) alignment.

GlobalVariable * AsyncFuncPointer

Align getContextAlignment() const

uint64_t ContextHeaderSize

uint64_t ContextAlignment

bool IsFrameInlineInStorage

Function * ResumePrototype

AllocaInst * PromiseAlloca

SwitchInst * ResumeSwitch

BasicBlock * ResumeEntryBlock

SmallVector< CallInst *, 2 > SymmetricTransfers

SmallVector< CoroAwaitSuspendInst *, 4 > CoroAwaitSuspends

AsyncLoweringStorage AsyncLowering

FunctionType * getResumeFunctionType() const

IntegerType * getIndexType() const

AnyCoroIdRetconInst * getRetconCoroId() const

PointerType * getSwitchResumePointerType() const

CoroIdInst * getSwitchCoroId() const

SmallVector< CoroSizeInst *, 2 > CoroSizes

CallingConv::ID getResumeFunctionCC() const

ArrayRef< Type * > getRetconResumeTypes() const

SmallVector< AnyCoroSuspendInst *, 4 > CoroSuspends

Value * emitAlloc(IRBuilder<> &Builder, Value *Size, CallGraph *CG) const

Allocate memory according to the rules of the active lowering.

void cleanCoroutine(SmallVectorImpl< CoroFrameInst * > &CoroFrames, SmallVectorImpl< CoroSaveInst * > &UnusedCoroSaves)

ConstantInt * getIndex(uint64_t Value) const

AllocaInst * getPromiseAlloca() const

SwitchLoweringStorage SwitchLowering

CoroBeginInst * CoroBegin

BasicBlock::iterator getInsertPtAfterFramePtr() const

ArrayRef< Type * > getRetconResultTypes() const

void emitDealloc(IRBuilder<> &Builder, Value *Ptr, CallGraph *CG) const

Deallocate memory according to the rules of the active lowering.

RetconLoweringStorage RetconLowering

SmallVector< CoroAlignInst *, 2 > CoroAligns

CoroIdAsyncInst * getAsyncCoroId() const

SmallVector< AnyCoroEndInst *, 4 > CoroEnds

SmallVector< CallInst *, 2 > SwiftErrorOps

void invalidateCoroutine(Function &F, SmallVectorImpl< CoroFrameInst * > &CoroFrames)

BasicBlock * AllocaSpillBlock

unsigned getSwitchIndexField() const

void analyze(Function &F, SmallVectorImpl< CoroFrameInst * > &CoroFrames, SmallVectorImpl< CoroSaveInst * > &UnusedCoroSaves)