LLVM 22.0.0git
SpillUtils.h
Go to the documentation of this file.
1//===- SpillUtils.h - Utilities for han dling for spills ------------------===//
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
12
13#ifndef LLVM_TRANSFORMS_COROUTINES_SPILLINGINFO_H
14#define LLVM_TRANSFORMS_COROUTINES_SPILLINGINFO_H
15
16namespace llvm::coro {
17
19
30
32 const SuspendCrossingInfo &Checker);
34 SpillInfo &Spills, SmallVector<AllocaInfo, 8> &Allocas,
35 SmallVector<Instruction *, 4> &DeadInstructions,
37 const SuspendCrossingInfo &Checker, const DominatorTree &DT,
38 const coro::Shape &Shape);
39
41 const SuspendCrossingInfo &Checker);
42
43/// Async and Retcon{Once} conventions assume that all spill uses can be sunk
44/// after the coro.begin intrinsic.
46 CoroBeginInst *CoroBegin,
47 coro::SpillInfo &Spills,
49
50// Get the insertion point for a spill after a Def.
52 const DominatorTree &DT);
53
54} // namespace llvm::coro
55
56#endif // LLVM_TRANSFORMS_COROUTINES_SPILLINGINFO_H
#define F(x, y, z)
Definition MD5.cpp:55
an instruction to allocate memory on the stack
InstListType::iterator iterator
Instruction iterators...
Definition BasicBlock.h:170
This class represents the llvm.coro.begin or llvm.coro.begin.custom.abi instructions.
Definition CoroInstr.h:461
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:165
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM Value Representation.
Definition Value.h:75
SmallMapVector< Value *, SmallVector< Instruction *, 2 >, 8 > SpillInfo
Definition SpillUtils.h:18
BasicBlock::iterator getSpillInsertionPt(const coro::Shape &, Value *Def, const DominatorTree &DT)
void sinkSpillUsesAfterCoroBegin(const DominatorTree &DT, CoroBeginInst *CoroBegin, coro::SpillInfo &Spills, SmallVectorImpl< coro::AllocaInfo > &Allocas)
Async and Retcon{Once} conventions assume that all spill uses can be sunk after the coro....
void collectSpillsFromArgs(SpillInfo &Spills, Function &F, const SuspendCrossingInfo &Checker)
void collectSpillsFromDbgInfo(SpillInfo &Spills, Function &F, const SuspendCrossingInfo &Checker)
void collectSpillsAndAllocasFromInsts(SpillInfo &Spills, SmallVector< AllocaInfo, 8 > &Allocas, SmallVector< Instruction *, 4 > &DeadInstructions, SmallVector< CoroAllocaAllocInst *, 4 > &LocalAllocas, Function &F, const SuspendCrossingInfo &Checker, const DominatorTree &DT, const coro::Shape &Shape)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1867
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:867
A MapVector that performs no allocations if smaller than a certain size.
Definition MapVector.h:257
AllocaInst * Alloca
Definition SpillUtils.h:21
DenseMap< Instruction *, std::optional< APInt > > Aliases
Definition SpillUtils.h:22
AllocaInfo(AllocaInst *Alloca, DenseMap< Instruction *, std::optional< APInt > > Aliases, bool MayWriteBeforeCoroBegin)
Definition SpillUtils.h:24