15#ifndef LLVM_TRANSFORMS_COROUTINES_SUSPENDCROSSINGINFO_H
16#define LLVM_TRANSFORMS_COROUTINES_SUSPENDCROSSINGINFO_H
28class ModuleSlotTracker;
35 size_t size()
const {
return V.size(); }
45 assert(
I != V.end() && *
I == BB &&
"BasicBlockNumberng: Unknown block");
75 bool KillLoop =
false;
93 template <
bool Initialize = false>
97#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
120 auto *
I = cast<Instruction>(U);
124 if (
auto *PN = dyn_cast<PHINode>(
I))
125 if (PN->getNumIncomingValues() > 1)
133 if (isa<CoroSuspendRetconInst>(
I) || isa<CoroSuspendAsyncInst>(
I)) {
135 assert(UseBB &&
"should have split coro.suspend into its own block");
146 auto *DefBB =
I.getParent();
151 if (isa<AnyCoroSuspendInst>(
I)) {
152 DefBB = DefBB->getSingleSuccessor();
153 assert(DefBB &&
"should have split coro.suspend into its own block");
160 if (
auto *Arg = dyn_cast<Argument>(&V))
162 if (
auto *Inst = dyn_cast<Instruction>(&V))
166 "Coroutine could only collect Argument and Instruction now.");
170 if (
auto *Arg = dyn_cast<Argument>(&V)) {
171 for (
User *U : Arg->users())
174 }
else if (
auto *Inst = dyn_cast<Instruction>(&V)) {
175 for (
User *U : Inst->users())
181 "Coroutine could only collect Argument and Instruction now.");
This file implements the BitVector class.
BlockVerifier::State From
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file builds on the ADT/GraphTraits.h file to build a generic graph post order iterator.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
This class represents an incoming formal argument to a Function.
LLVM Basic Block Representation.
const BasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor block.
size_t blockToIndex(BasicBlock const *BB) const
BasicBlock * indexToBlock(unsigned Index) const
BlockToIndexMapping(Function &F)
Manage lifetime of a slot tracker for printing IR.
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.
StringRef - Represent a constant reference to a string, i.e.
bool isDefinitionAcrossSuspend(Value &V) const
bool isDefinitionAcrossSuspend(Value &V, User *U) const
bool isDefinitionAcrossSuspend(BasicBlock *DefBB, User *U) const
bool hasPathCrossingSuspendPoint(BasicBlock *From, BasicBlock *To) const
Returns true if there is a path from From to To crossing a suspend point without crossing From a 2nd ...
bool isDefinitionAcrossSuspend(Instruction &I, User *U) const
bool hasPathOrLoopCrossingSuspendPoint(BasicBlock *From, BasicBlock *To) const
Returns true if there is a path from From to To crossing a suspend point without crossing From a 2nd ...
bool isDefinitionAcrossSuspend(Argument &A, User *U) const
LLVM Value Representation.
A range adaptor for a pair of iterators.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
void sort(IteratorTy Start, IteratorTy End)
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
auto predecessors(const MachineBasicBlock *BB)