12#ifndef LLVM_LIB_TRANSFORMS_COROUTINES_COROCLONER_H
13#define LLVM_LIB_TRANSFORMS_COROUTINES_COROCLONER_H
71 assert(
NewF &&
"need existing function for continuation");
98 assert(
NewF !=
nullptr &&
"declaration not yet set");
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
The TimeTraceScope is a helper class to call the begin and end functions of the time trace profiler.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
void replaceSwiftErrorOps()
AnyCoroSuspendInst * ActiveSuspend
The active suspend instruction; meaningful only for continuation and async ABIs.
Value * deriveNewFramePointer()
Derive the value of the new frame pointer.
void replaceCoroSuspends()
void handleFinalSuspend()
TargetTransformInfo & TTI
BaseCloner(Function &OrigF, const Twine &Suffix, coro::Shape &Shape, Function *NewF, AnyCoroSuspendInst *ActiveSuspend, TargetTransformInfo &TTI)
Create a cloner for a continuation lowering.
static Function * createClone(Function &OrigF, const Twine &Suffix, coro::Shape &Shape, Function *NewF, AnyCoroSuspendInst *ActiveSuspend, TargetTransformInfo &TTI)
Create a clone for a continuation lowering.
BaseCloner(Function &OrigF, const Twine &Suffix, coro::Shape &Shape, CloneKind FKind, TargetTransformInfo &TTI)
bool isSwitchDestroyFunction()
Function * getFunction() const
void replaceRetconOrAsyncSuspendUses()
Replace uses of the active llvm.coro.suspend.retcon/async call with the arguments to the continuation...
virtual void create()
Clone the body of the original function into a resume function of some sort.
static Function * createClone(Function &OrigF, const Twine &Suffix, coro::Shape &Shape, CloneKind FKind, TargetTransformInfo &TTI)
Create a clone for a switch lowering.
void create() override
Clone the body of the original function into a resume function of some sort.
SwitchCloner(Function &OrigF, const Twine &Suffix, coro::Shape &Shape, CloneKind FKind, TargetTransformInfo &TTI)
Create a cloner for a switch lowering.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ 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...
@ Async
An async resume function.
@ SwitchCleanup
The shared cleanup function for a switch lowering.
@ SwitchResume
The shared resume function for a switch lowering.
@ SwitchUnwind
The shared unwind function for a switch lowering.
@ Continuation
An individual continuation function.
This is an optimization pass for GlobalISel generic memory operations.