LLVM 22.0.0git
SpillUtils.cpp File Reference

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 InstructionlowerNonLocalAlloca (CoroAllocaAllocInst *AI, const Shape &Shape, SmallVectorImpl< Instruction * > &DeadInsts)
 Turn the given coro.alloca.alloc call into a dynamic allocation.
static InstructionsplitBeforeCatchSwitch (CatchSwitchInst *CatchSwitch)
static void collectFrameAlloca (AllocaInst *AI, const coro::Shape &Shape, const SuspendCrossingInfo &Checker, SmallVectorImpl< AllocaInfo > &Allocas, const DominatorTree &DT)

Typedef Documentation

◆ VisitedBlocksSet

Definition at line 22 of file SpillUtils.cpp.

Function Documentation

◆ collectFrameAlloca()

◆ isLocalAlloca()

bool isLocalAlloca ( CoroAllocaAllocInst * AI)
static

◆ isNonSpilledIntrinsic()

bool isNonSpilledIntrinsic ( Instruction & I)
static

Definition at line 24 of file SpillUtils.cpp.

References I, and llvm::isa().

Referenced by llvm::coro::collectSpillsAndAllocasFromInsts().

◆ isSuspendReachableFrom()

bool isSuspendReachableFrom ( BasicBlock * From,
VisitedBlocksSet & VisitedOrFreeBBs )
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().

◆ lowerNonLocalAlloca()

Instruction * lowerNonLocalAlloca ( CoroAllocaAllocInst * AI,
const Shape & Shape,
SmallVectorImpl< Instruction * > & DeadInsts )
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().

◆ splitBeforeCatchSwitch()