LLVM 20.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 {
17
18namespace coro {
19
21
22struct AllocaInfo {
27 DenseMap<Instruction *, std::optional<APInt>> Aliases,
31};
32
34 const SuspendCrossingInfo &Checker);
36 SpillInfo &Spills, SmallVector<AllocaInfo, 8> &Allocas,
37 SmallVector<Instruction *, 4> &DeadInstructions,
39 const SuspendCrossingInfo &Checker, const DominatorTree &DT,
40 const coro::Shape &Shape);
42 const SuspendCrossingInfo &Checker);
43
44/// Async and Retcon{Once} conventions assume that all spill uses can be sunk
45/// after the coro.begin intrinsic.
47 CoroBeginInst *CoroBegin,
48 coro::SpillInfo &Spills,
50
51// Get the insertion point for a spill after a Def.
53 const DominatorTree &DT);
54
55} // namespace coro
56
57} // namespace llvm
58
59#endif // LLVM_TRANSFORMS_COROUTINES_SPILLINGINFO_H
#define F(x, y, z)
Definition: MD5.cpp:55
an instruction to allocate memory on the stack
Definition: Instructions.h:63
InstListType::iterator iterator
Instruction iterators...
Definition: BasicBlock.h:177
This class represents the llvm.coro.begin or llvm.coro.begin.custom.abi instructions.
Definition: CoroInstr.h:448
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition: Dominators.h:162
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:573
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1196
LLVM Value Representation.
Definition: Value.h:74
BasicBlock::iterator getSpillInsertionPt(const coro::Shape &, Value *Def, const DominatorTree &DT)
Definition: SpillUtils.cpp:586
SmallMapVector< Value *, SmallVector< Instruction *, 2 >, 8 > SpillInfo
Definition: SpillUtils.h:20
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....
Definition: SpillUtils.cpp:539
void collectSpillsFromArgs(SpillInfo &Spills, Function &F, const SuspendCrossingInfo &Checker)
Definition: SpillUtils.cpp:452
void collectSpillsFromDbgInfo(SpillInfo &Spills, Function &F, const SuspendCrossingInfo &Checker)
Definition: SpillUtils.cpp:516
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)
Definition: SpillUtils.cpp:461
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:1873
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
A MapVector that performs no allocations if smaller than a certain size.
Definition: MapVector.h:254
AllocaInst * Alloca
Definition: SpillUtils.h:23
DenseMap< Instruction *, std::optional< APInt > > Aliases
Definition: SpillUtils.h:24
AllocaInfo(AllocaInst *Alloca, DenseMap< Instruction *, std::optional< APInt > > Aliases, bool MayWriteBeforeCoroBegin)
Definition: SpillUtils.h:26