LLVM: lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

23using namespace llvm;

24

26

30 const {

31

32

34}

35

37 assert(WARegs.empty());

39 WARegs.resize(MRI.getNumVirtRegs(), Reg);

40}

41

47

48 for (EVT VT : VTs) {

51 for (unsigned I = 0; I != NumRegs; ++I)

53 }

54}

55

62}

63

71

76

77

78

79

82 }

83

84 for (auto *Param : Ty->params())

88

89

90

91

92

93

96 bool HasSwiftErrorArg = false;

97 bool HasSwiftSelfArg = false;

98 for (const auto &Arg : TargetFunc->args()) {

99 HasSwiftErrorArg |= Arg.hasAttribute(Attribute::SwiftError);

100 HasSwiftSelfArg |= Arg.hasAttribute(Attribute::SwiftSelf);

101 }

102 if (!HasSwiftErrorArg)

104 if (!HasSwiftSelfArg)

106 }

107}

108

111 for (MVT Ty : In)

113}

114

121 return Sig;

122}

123

126 : CFGStackified(MFI.isCFGStackified()) {

128 Params.push_back(EVT(VT).getEVTString());

130 Results.push_back(EVT(VT).getEVTString());

131

132

133

134

136

137

138

140 for (const auto &MBB : MF)

142 for (auto KV : EHInfo->SrcToUnwindDest) {

143 auto *SrcBB = cast<MachineBasicBlock *>(KV.first);

144 auto *DestBB = cast<MachineBasicBlock *>(KV.second);

145 if (MBBs.count(SrcBB) && MBBs.count(DestBB))

146 SrcToUnwindDest[SrcBB->getNumber()] = DestBB->getNumber();

147 }

148 }

149}

150

153}

154

158 for (auto VT : YamlMFI.Params)

160 for (auto VT : YamlMFI.Results)

162

163

164

165

170 }

171}

unsigned const MachineRegisterInfo * MRI

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

Function Alias Analysis Results

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

This file defines the interfaces that WebAssembly uses to lower LLVM code into a selection DAG.

This file declares WebAssembly-specific per-machine-function information.

This file declares the WebAssembly-specific subclass of TargetSubtarget.

This file contains the declaration of the WebAssembly-specific type parsing utility functions.

This file contains the declaration of the WebAssembly-specific utility functions.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

Allocate memory in an ever growing pool, as if by bump-pointer.

A parsed version of the target data layout string in and methods for querying it.

Class to represent function types.

ArrayRef< Type * > params() const

Type * getReturnType() const

iterator_range< arg_iterator > args()

CallingConv::ID getCallingConv() const

getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...

This is an important class for using LLVM in a threaded context.

Context object for machine code objects.

wasm::WasmSignature * createWasmSignature()

Allocates and returns a new WasmSignature instance (with empty parameter and return type lists).

static MVT getIntegerVT(unsigned BitWidth)

MachineBasicBlock * getBlockNumbered(unsigned N) const

getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...

const WasmEHFuncInfo * getWasmEHFuncInfo() const

getWasmEHFuncInfo - Return information about how the current function uses Wasm exception handling.

Ty * cloneInfo(const Ty &Old)

MachineRegisterInfo - Keep track of information for virtual and physical registers,...

size_type count(ConstPtrType Ptr) const

count - Return 1 if the specified pointer is in the set, 0 otherwise.

std::pair< iterator, bool > insert(PtrType Ptr)

Inserts Ptr if and only if there is no element in the container equal to Ptr.

SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

void push_back(const T &Elt)

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

virtual unsigned getNumRegisters(LLVMContext &Context, EVT VT, std::optional< MVT > RegisterVT=std::nullopt) const

Return the number of registers that this ValueType will eventually require.

MVT getRegisterType(MVT VT) const

Return the type of registers that this ValueType will eventually require.

Primary interface to the complete machine description for the target machine.

The instances of the Type class are immutable: once they are created, they are never changed.

This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...

~WebAssemblyFunctionInfo() override

const std::vector< MVT > & getResults() const

MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override

Make a functionally equivalent copy of this MachineFunctionInfo in MF.

void initWARegs(MachineRegisterInfo &MRI)

void initializeBaseYamlFields(MachineFunction &MF, const yaml::WebAssemblyFunctionInfo &YamlMFI)

const std::vector< MVT > & getParams() const

@ Swift

Calling convention for Swift.

wasm::ValType toValType(MVT Type)

static const unsigned UnusedReg

bool canLowerReturn(size_t ResultSize, const WebAssemblySubtarget *Subtarget)

Returns true if the function's return value(s) can be lowered directly, i.e., not indirectly via a po...

MVT parseMVT(StringRef Type)

This is an optimization pass for GlobalISel generic memory operations.

void computeSignatureVTs(const FunctionType *Ty, const Function *TargetFunc, const Function &ContextFunc, const TargetMachine &TM, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results)

void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< EVT > *MemVTs, SmallVectorImpl< TypeSize > *Offsets=nullptr, TypeSize StartingOffset=TypeSize::getZero())

ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...

void valTypesFromMVTs(ArrayRef< MVT > In, SmallVectorImpl< wasm::ValType > &Out)

wasm::WasmSignature * signatureFromMVTs(MCContext &Ctx, const SmallVectorImpl< MVT > &Results, const SmallVectorImpl< MVT > &Params)

void computeLegalValueVTs(const WebAssemblyTargetLowering &TLI, LLVMContext &Ctx, const DataLayout &DL, Type *Ty, SmallVectorImpl< MVT > &ValueVTs)

MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...

WebAssemblyFunctionInfo()=default

void mappingImpl(yaml::IO &YamlIO) override

std::vector< FlowStringValue > Results

std::vector< FlowStringValue > Params

BBNumberMap SrcToUnwindDest