LLVM 22.0.0git
|
#include "llvm/Transforms/Coroutines/SpillUtils.h"
#include "CoroInternal.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/PtrUseVisitor.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
Go to the source code of this file.
Typedefs | |
typedef SmallPtrSet< BasicBlock *, 8 > | VisitedBlocksSet |
Functions | |
static bool | isNonSpilledIntrinsic (Instruction &I) |
static bool | isSuspendReachableFrom (BasicBlock *From, VisitedBlocksSet &VisitedOrFreeBBs) |
Does control flow starting at the given block ever reach a suspend instruction before reaching a block in VisitedOrFreeBBs? | |
static bool | isLocalAlloca (CoroAllocaAllocInst *AI) |
Is the given alloca "local", i.e. | |
static Instruction * | lowerNonLocalAlloca (CoroAllocaAllocInst *AI, const Shape &Shape, SmallVectorImpl< Instruction * > &DeadInsts) |
Turn the given coro.alloca.alloc call into a dynamic allocation. | |
static Instruction * | splitBeforeCatchSwitch (CatchSwitchInst *CatchSwitch) |
static void | collectFrameAlloca (AllocaInst *AI, const coro::Shape &Shape, const SuspendCrossingInfo &Checker, SmallVectorImpl< AllocaInfo > &Allocas, const DominatorTree &DT) |
typedef SmallPtrSet<BasicBlock *, 8> VisitedBlocksSet |
Definition at line 22 of file SpillUtils.cpp.
|
static |
Definition at line 418 of file SpillUtils.cpp.
References llvm::coro::Shape::ABI, llvm::coro::Async, llvm::coro::Shape::CoroSuspends, llvm::SmallVectorImpl< T >::emplace_back(), llvm::Instruction::getDataLayout(), llvm::Instruction::hasMetadata(), llvm::coro::Shape::SwitchLoweringStorage::PromiseAlloca, llvm::coro::Retcon, llvm::coro::RetconOnce, and llvm::coro::Shape::SwitchLowering.
Referenced by llvm::coro::collectSpillsAndAllocasFromInsts().
|
static |
Is the given alloca "local", i.e.
bounded in lifetime to not cross a suspend point?
Definition at line 55 of file SpillUtils.cpp.
References llvm::dyn_cast(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::SmallPtrSetImpl< PtrType >::insert(), isSuspendReachableFrom(), and llvm::Value::users().
Referenced by llvm::coro::collectSpillsAndAllocasFromInsts().
|
static |
Definition at line 24 of file SpillUtils.cpp.
References I, and llvm::isa().
Referenced by llvm::coro::collectSpillsAndAllocasFromInsts().
|
static |
Does control flow starting at the given block ever reach a suspend instruction before reaching a block in VisitedOrFreeBBs?
Definition at line 32 of file SpillUtils.cpp.
References llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::coro::isSuspendBlock(), isSuspendReachableFrom(), and llvm::successors().
Referenced by isLocalAlloca(), and isSuspendReachableFrom().
|
static |
Turn the given coro.alloca.alloc call into a dynamic allocation.
This happens during the all-instructions iteration, so it must not delete the call.
Definition at line 71 of file SpillUtils.cpp.
References Alloc, llvm::cast(), llvm::coro::Shape::emitAlloc(), llvm::coro::Shape::emitDealloc(), llvm::CoroAllocaAllocInst::getSize(), llvm::isa(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Value::users().
Referenced by llvm::coro::collectSpillsAndAllocasFromInsts().
|
static |
Definition at line 103 of file SpillUtils.cpp.
References llvm::CleanupPadInst::Create(), llvm::CleanupReturnInst::Create(), llvm::Instruction::eraseFromParent(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::CatchSwitchInst::getParentPad(), llvm::BasicBlock::getTerminator(), and llvm::BasicBlock::splitBasicBlock().
Referenced by llvm::coro::getSpillInsertionPt().