|
LLVM
4.0.0
|
#include "CoroInternal.h"#include "llvm/Analysis/CallGraphSCCPass.h"#include "llvm/IR/DebugInfoMetadata.h"#include "llvm/IR/IRBuilder.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 35 of file CoroSplit.cpp.
|
static |
Definition at line 181 of file CoroSplit.cpp.
References A, llvm::Function::addAttribute(), llvm::coro::Shape::AllocaSpillBlock, 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::Function::getArgumentList(), llvm::CoroBeginInst::getId(), llvm::Type::getInt8PtrTy(), llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::Function::getSubprogram(), handleFinalSuspend(), llvm::coro::Shape::HasFinalSuspend, llvm::ValueMap< KeyT, ValueT, Config >::MD(), llvm::NoAlias, llvm::Value::replaceAllUsesWith(), llvm::coro::replaceCoroFree(), replaceFallthroughCoroEnd(), llvm::coro::Shape::ResumeSwitch, llvm::MCID::Return, llvm::AttributeSet::ReturnIndex, Switch(), and llvm::AttributeFuncs::typeIncompatible().
Referenced by splitCoroutine().
|
static |
Definition at line 555 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 39 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 156 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 381 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 635 of file CoroSplit.cpp.
|
static |
Definition at line 364 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 527 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 286 of file CoroSplit.cpp.
References llvm::coro::Shape::CoroEnds, and llvm::Instruction::eraseFromParent().
Referenced by splitCoroutine().
|
static |
Definition at line 136 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 291 of file CoroSplit.cpp.
References llvm::coro::Shape::CoroSizes, llvm::Instruction::eraseFromParent(), llvm::coro::Shape::FrameTy, llvm::ConstantInt::get(), llvm::Module::getDataLayout(), llvm::DataLayout::getTypeAllocSize(), and llvm::Value::replaceAllUsesWith().
Referenced by splitCoroutine().
|
static |
Definition at line 319 of file CoroSplit.cpp.
References AMDGPU::RuntimeMD::KeyName::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 408 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 462 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 480 of file CoroSplit.cpp.
References llvm::coro::buildCoroutineFrame(), llvm::coro::Shape::CoroBegin, llvm::coro::Shape::CoroSuspends, createClone(), createResumeEntryBlock(), llvm::coro::Shape::FrameTy, handleNoSuspendCoroutine(), postSplitCleanup(), removeCoroEnds(), replaceFrameSize(), setCoroInfo(), simplifySuspendPoints(), llvm::coro::updateCallGraph(), and updateCoroFrame().
|
static |
Definition at line 340 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