|
LLVM
5.0.0
|
#include "CoroInternal.h"#include "llvm/Analysis/CallGraphSCCPass.h"#include "llvm/IR/DebugInfoMetadata.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/LegacyPassManager.h"#include "llvm/IR/Verifier.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Utils/Cloning.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/ValueMapper.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "coro-split" |
| #define DEBUG_TYPE "coro-split" |
Definition at line 36 of file CoroSplit.cpp.
|
static |
Definition at line 209 of file CoroSplit.cpp.
References A, llvm::Function::addParamAttr(), llvm::coro::Shape::AllocaSpillBlock, llvm::Function::args(), llvm::changeToUnreachable(), llvm::CloneFunctionInto(), llvm::coro::Shape::CoroBegin, llvm::coro::Shape::CoroEnds, llvm::coro::Shape::CoroSuspends, llvm::Function::Create(), llvm::BranchInst::Create(), llvm::CallingConv::Fast, llvm::coro::Shape::FramePtr, llvm::coro::Shape::FrameTy, llvm::UndefValue::get(), llvm::CoroBeginInst::getId(), llvm::Type::getInt8PtrTy(), llvm::Value::getName(), llvm::GlobalValue::getParent(), handleFinalSuspend(), llvm::coro::Shape::HasFinalSuspend, llvm::NoAlias, llvm::Value::replaceAllUsesWith(), llvm::coro::replaceCoroFree(), replaceFallthroughCoroEnd(), replaceUnwindCoroEnds(), llvm::coro::Shape::ResumeSwitch, llvm::MCID::Return, llvm::AttributeList::ReturnIndex, Switch(), and llvm::AttributeFuncs::typeIncompatible().
Referenced by splitCoroutine().
|
static |
Definition at line 654 of file CoroSplit.cpp.
References llvm::Function::addFnAttr(), llvm::CallGraphSCC::begin(), C, CORO_DEVIRT_TRIGGER_FN, llvm::CallGraphSCC::end(), llvm::Module::getContext(), llvm::Module::getFunction(), llvm::CallGraph::getModule(), llvm::CallGraph::getOrInsertFunction(), llvm::CallGraphSCC::initialize(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
|
static |
Definition at line 40 of file CoroSplit.cpp.
References C, llvm::coro::Shape::CoroSuspends, llvm::BasicBlock::Create(), llvm::PHINode::Create(), llvm::IRBuilder< T, Inserter >::CreateConstInBoundsGEP2_32(), llvm::IRBuilder< T, Inserter >::CreateLoad(), llvm::IRBuilder< T, Inserter >::CreateStore(), llvm::IRBuilder< T, Inserter >::CreateSwitch(), llvm::IRBuilder< T, Inserter >::CreateUnreachable(), FramePtr, llvm::coro::Shape::FramePtr, llvm::coro::Shape::FrameTy, llvm::ConstantPointerNull::get(), llvm::ConstantTokenNone::get(), llvm::Function::getContext(), llvm::CoroSuspendInst::getCoroSave(), llvm::coro::Shape::getIndex(), llvm::IRBuilderBase::getInt8(), llvm::IRBuilderBase::getInt8Ty(), llvm::Value::getName(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::Instruction::getParent(), llvm::coro::Shape::IndexField, llvm::CoroSuspendInst::isFinal(), llvm::Value::replaceAllUsesWith(), llvm::coro::Shape::ResumeSwitch, llvm::IRBuilderBase::SetInsertPoint(), llvm::BasicBlock::splitBasicBlock(), and Switch().
Referenced by splitCoroutine().
|
static |
Definition at line 504 of file CoroSplit.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SmallVectorBase::empty(), llvm::Instruction::getParent(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::predecessors(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by relocateInstructionBefore().
|
static |
Definition at line 522 of file CoroSplit.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::Instruction::getParent(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::User::operands(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by relocateInstructionBefore().
|
static |
Definition at line 184 of file CoroSplit.cpp.
References assert(), llvm::SwitchInst::case_end(), llvm::IRBuilder< T, Inserter >::CreateCondBr(), llvm::IRBuilder< T, Inserter >::CreateConstInBoundsGEP2_32(), llvm::IRBuilder< T, Inserter >::CreateICmpEQ(), llvm::IRBuilder< T, Inserter >::CreateLoad(), llvm::Instruction::eraseFromParent(), llvm::coro::Shape::FrameTy, llvm::ConstantPointerNull::get(), llvm::Instruction::getParent(), llvm::BasicBlock::getTerminator(), llvm::coro::Shape::HasFinalSuspend, llvm::SPII::Load, llvm::SwitchInst::removeCase(), llvm::IRBuilderBase::SetInsertPoint(), and llvm::BasicBlock::splitBasicBlock().
Referenced by createClone().
|
static |
Definition at line 405 of file CoroSplit.cpp.
References llvm::IRBuilder< T, Inserter >::CreateAlloca(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::Instruction::eraseFromParent(), llvm::CoroIdInst::getCoroAlloc(), llvm::IRBuilderBase::getFalse(), llvm::CoroBeginInst::getId(), llvm::IRBuilderBase::getInt8PtrTy(), llvm::CoroBeginInst::getMem(), llvm::Value::replaceAllUsesWith(), and llvm::coro::replaceCoroFree().
Referenced by splitCoroutine().
| INITIALIZE_PASS | ( | CoroSplit | , |
| "coro-split" | , | ||
| "Split coroutine into a set of functions driving its state machine" | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 737 of file CoroSplit.cpp.
|
static |
Definition at line 388 of file CoroSplit.cpp.
References llvm::legacy::FunctionPassManager::add(), llvm::createCFGSimplificationPass(), llvm::createEarlyCSEPass(), llvm::createSCCPPass(), llvm::createVerifierPass(), llvm::GlobalValue::getParent(), and llvm::removeUnreachableBlocks().
Referenced by splitCoroutine().
Definition at line 626 of file CoroSplit.cpp.
References llvm::Function::addFnAttr(), assert(), CORO_DEVIRT_TRIGGER_FN, CORO_PRESPLIT_ATTR, F, llvm::CallGraph::getCallsExternalNode(), llvm::Function::getContext(), llvm::Function::getEntryBlock(), llvm::Module::getFunction(), llvm::GlobalValue::getParent(), llvm::BasicBlock::getTerminator(), llvm::coro::LowererBase::makeSubFnCall(), Null, and PREPARED_FOR_SPLIT.
|
static |
Definition at line 555 of file CoroSplit.cpp.
References B, llvm::BasicBlock::begin(), E, llvm::BasicBlock::end(), getCoroBeginPredBlocks(), llvm::Function::getEntryBlock(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), getNotRelocatableInstructions(), I, and llvm::Instruction::moveBefore().
Referenced by splitCoroutine().
|
static |
Definition at line 302 of file CoroSplit.cpp.
References Context, llvm::coro::Shape::CoroEnds, llvm::Instruction::eraseFromParent(), llvm::ConstantInt::getFalse(), and llvm::Value::replaceAllUsesWith().
Referenced by splitCoroutine().
|
static |
Definition at line 137 of file CoroSplit.cpp.
References llvm::ReturnInst::Create(), llvm::WebAssembly::End, llvm::Instruction::eraseFromParent(), llvm::Instruction::getParent(), llvm::BasicBlock::getTerminator(), and llvm::BasicBlock::splitBasicBlock().
Referenced by createClone().
|
static |
Definition at line 315 of file CoroSplit.cpp.
References llvm::coro::Shape::CoroSizes, llvm::DL, llvm::Instruction::eraseFromParent(), llvm::coro::Shape::FrameTy, llvm::ConstantInt::get(), llvm::Module::getDataLayout(), llvm::DataLayout::getTypeAllocSize(), llvm::Value::replaceAllUsesWith(), and llvm::AMDGPU::CodeObject::Kernel::Arg::Key::Size.
Referenced by splitCoroutine().
|
static |
Definition at line 150 of file CoroSplit.cpp.
References Context, llvm::coro::Shape::CoroEnds, llvm::CleanupReturnInst::Create(), llvm::ConstantInt::getTrue(), llvm::CoroEndInst::isUnwind(), and llvm::LLVMContext::OB_funclet.
Referenced by createClone().
|
static |
Definition at line 343 of file CoroSplit.cpp.
References llvm::AMDGPU::CodeObject::Kernel::Key::Args, assert(), llvm::Function::begin(), C, llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::Function::getContext(), llvm::CoroBeginInst::getId(), llvm::Type::getInt8PtrTy(), llvm::Value::getName(), llvm::ConstantExpr::getPointerCast(), llvm::GlobalValue::PrivateLinkage, and llvm::CoroIdInst::setInfo().
Referenced by splitCoroutine().
|
static |
Definition at line 432 of file CoroSplit.cpp.
References llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledValue(), llvm::CoroSuspendInst::getCoroSave(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Instruction::getParent(), I, llvm::Value::replaceAllUsesWith(), and llvm::Value::stripPointerCasts().
Referenced by simplifySuspendPoints().
|
static |
Definition at line 486 of file CoroSplit.cpp.
References llvm::coro::Shape::CoroBegin, llvm::coro::Shape::CoroSuspends, I, N, simplifySuspendPoint(), and std::swap().
Referenced by splitCoroutine().
|
static |
Definition at line 578 of file CoroSplit.cpp.
References llvm::coro::buildCoroutineFrame(), llvm::coro::Shape::CoroBegin, llvm::coro::Shape::CoroSuspends, createClone(), createResumeEntryBlock(), llvm::coro::Shape::FrameTy, handleNoSuspendCoroutine(), postSplitCleanup(), relocateInstructionBefore(), removeCoroEnds(), replaceFrameSize(), setCoroInfo(), simplifySuspendPoints(), llvm::coro::updateCallGraph(), and updateCoroFrame().
|
static |
Definition at line 364 of file CoroSplit.cpp.
References llvm::coro::Shape::CoroBegin, llvm::IRBuilder< T, Inserter >::CreateConstInBoundsGEP2_32(), llvm::coro::Shape::DestroyField, llvm::coro::Shape::FramePtr, llvm::coro::Shape::FrameTy, llvm::CoroIdInst::getCoroAlloc(), llvm::CoroBeginInst::getId(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), and llvm::coro::Shape::ResumeField.
Referenced by splitCoroutine().
1.8.6