Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
CoroInternal.h
Go to the documentation of this file.
1//===- CoroInternal.h - Internal Coroutine interfaces ---------*- C++ -*---===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8// Common definitions/declarations used internally by coroutine lowering passes.
9//===----------------------------------------------------------------------===//
10
11#ifndef LLVM_LIB_TRANSFORMS_COROUTINES_COROINTERNAL_H
12#define LLVM_LIB_TRANSFORMS_COROUTINES_COROINTERNAL_H
13
15#include "llvm/IR/IRBuilder.h"
18
19namespace llvm {
20
21class CallGraph;
22
23namespace coro {
24
25bool isSuspendBlock(BasicBlock *BB);
26bool declaresAnyIntrinsic(const Module &M);
28void replaceCoroFree(CoroIdInst *CoroId, bool Elide);
29
30/// Replaces all @llvm.coro.alloc intrinsics calls associated with a given
31/// call @llvm.coro.id instruction with boolean value false.
32void suppressCoroAllocs(CoroIdInst *CoroId);
33/// Replaces CoroAllocs with boolean value false.
34void suppressCoroAllocs(LLVMContext &Context,
35 ArrayRef<CoroAllocInst *> CoroAllocs);
36
37/// Attempts to rewrite the location operand of debug records in terms of
38/// the coroutine frame pointer, folding pointer offsets into the DIExpression
39/// of the intrinsic.
40/// If the frame pointer is an Argument, store it into an alloca to enhance the
41/// debugability.
43 SmallDenseMap<Argument *, AllocaInst *, 4> &ArgToAllocaMap,
44 DbgVariableRecord &DVR, bool UseEntryValue);
45
46// Keeps data and helper functions for lowering coroutine intrinsics.
57
64} // End namespace coro.
65} // End namespace llvm
66
67#endif
AMDGPU Lower Kernel Arguments
#define F(x, y, z)
Definition MD5.cpp:55
Machine Check Debug Module
This pass exposes codegen information to IR-level passes.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
The basic data container for the call graph of a Module of IR.
Definition CallGraph.h:72
This class represents a function call, abstracting a target machine's calling convention.
A constant pointer value that points to null.
Definition Constants.h:558
A debug info location.
Definition DebugLoc.h:124
Class to represent function types.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Definition IRBuilder.h:2780
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:68
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
Class to represent pointers.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
LLVM Value Representation.
Definition Value.h:75
bool defaultMaterializable(Instruction &V)
Default materializable callback.
bool declaresAnyIntrinsic(const Module &M)
bool isSuspendBlock(BasicBlock *BB)
void suppressCoroAllocs(CoroIdInst *CoroId)
Replaces all @llvm.coro.alloc intrinsics calls associated with a given call @llvm....
void normalizeCoroutine(Function &F, coro::Shape &Shape, TargetTransformInfo &TTI)
CallInst * createMustTailCall(DebugLoc Loc, Function *MustTailCallFn, TargetTransformInfo &TTI, ArrayRef< Value * > Arguments, IRBuilder<> &)
void replaceCoroFree(CoroIdInst *CoroId, bool Elide)
bool declaresIntrinsics(const Module &M, ArrayRef< Intrinsic::ID > List)
void salvageDebugInfo(SmallDenseMap< Argument *, AllocaInst *, 4 > &ArgToAllocaMap, DbgVariableRecord &DVR, bool UseEntryValue)
Attempts to rewrite the location operand of debug records in terms of the coroutine frame pointer,...
This is an optimization pass for GlobalISel generic memory operations.
TargetTransformInfo TTI
ArrayRef(const T &OneElt) -> ArrayRef< T >
PointerType *const Int8Ptr
ConstantPointerNull *const NullPtr
CallInst * makeSubFnCall(Value *Arg, int Index, Instruction *InsertPt)
FunctionType *const ResumeFnType