15#ifndef LLVM_TRANSFORMS_COROUTINES_SUSPENDCROSSINGINFO_H
16#define LLVM_TRANSFORMS_COROUTINES_SUSPENDCROSSINGINFO_H
29class ModuleSlotTracker;
36 size_t size()
const {
return V.size(); }
46 assert(
I != V.end() && *
I == BB &&
"BasicBlockNumberng: Unknown block");
76 bool KillLoop =
false;
94 template <
bool Initialize = false>
98#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
123 auto *
I = cast<Instruction>(U);
127 if (
auto *PN = dyn_cast<PHINode>(
I))
128 if (PN->getNumIncomingValues() > 1)
136 if (isa<CoroSuspendRetconInst>(
I) || isa<CoroSuspendAsyncInst>(
I)) {
138 assert(UseBB &&
"should have split coro.suspend into its own block");
149 auto *DefBB =
I.getParent();
154 if (isa<AnyCoroSuspendInst>(
I)) {
155 DefBB = DefBB->getSingleSuccessor();
156 assert(DefBB &&
"should have split coro.suspend into its own block");
163 if (
auto *Arg = dyn_cast<Argument>(&V))
165 if (
auto *Inst = dyn_cast<Instruction>(&V))
169 "Coroutine could only collect Argument and Instruction now.");
173 if (
auto *Arg = dyn_cast<Argument>(&V)) {
174 for (
User *U : Arg->users())
177 }
else if (
auto *Inst = dyn_cast<Instruction>(&V)) {
178 for (
User *U : Inst->users())
184 "Coroutine could only collect Argument and Instruction now.");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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.
This file defines the SmallVector class.
This class represents an incoming formal argument to a Function.
LLVM Basic Block Representation.
LLVM_ABI 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
LLVM_ABI 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
LLVM_ABI 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)