15#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H
16#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H
33 std::vector<MVT> Params;
34 std::vector<MVT> Results;
35 std::vector<MVT> Locals;
38 std::vector<unsigned> WARegs;
51 unsigned VarargVreg = -1U;
55 unsigned BasePtrVreg = -1U;
58 unsigned FrameBaseVreg = -1U;
61 unsigned FrameBaseLocal = -1U;
64 bool CFGStackified =
false;
80 const std::vector<MVT> &
getParams()
const {
return Params; }
83 const std::vector<MVT> &
getResults()
const {
return Results; }
90 void setNumLocals(
size_t NumLocals) { Locals.resize(NumLocals, MVT::i32); }
93 const std::vector<MVT> &
getLocals()
const {
return Locals; }
96 assert(VarargVreg != -1U &&
"Vararg vreg hasn't been set");
102 assert(BasePtrVreg != -1U &&
"Base ptr vreg hasn't been set");
107 assert(FrameBaseVreg != -1U &&
"Frame base vreg hasn't been set");
108 return FrameBaseVreg;
115 assert(FrameBaseLocal != -1U &&
"Frame base local hasn't been set");
116 return FrameBaseLocal;
123 if (
I >= VRegStackified.size())
124 VRegStackified.resize(
I + 1);
125 VRegStackified.set(
I);
129 if (
I < VRegStackified.size())
130 VRegStackified.reset(
I);
134 if (
I >= VRegStackified.size())
136 return VRegStackified.test(
I);
157 LLVMContext &Ctx,
const DataLayout &
DL, Type *Ty,
158 SmallVectorImpl<MVT> &ValueVTs);
161 SmallVectorImpl<MVT> &ValueVTs);
166 const Function &ContextFunc,
const TargetMachine &TM,
167 SmallVectorImpl<MVT> &Params,
168 SmallVectorImpl<MVT> &
Results);
173 const SmallVectorImpl<MVT> &
Results,
174 const SmallVectorImpl<MVT> &Params);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Function Alias Analysis Results
This file provides WebAssembly-specific target descriptions.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
LLVM_ABI MachineInstr * getUniqueVRegDef(Register Reg) const
getUniqueVRegDef - Return the unique machine instr that defines the specified virtual register or nul...
Wrapper class representing virtual and physical registers.
unsigned virtRegIndex() const
Convert a virtual register number to a 0-based index.
TargetSubtargetInfo - Generic base class for all target subtargets.
LLVM Value Representation.
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
void setFrameBaseVreg(unsigned Reg)
bool isCFGStackified() const
WebAssemblyFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
~WebAssemblyFunctionInfo() override
const std::vector< MVT > & getResults() const
void stackifyVReg(MachineRegisterInfo &MRI, Register VReg)
unsigned getFrameBaseLocal() const
void setLocal(size_t i, MVT VT)
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 clearParamsAndResults()
void setBasePointerVreg(unsigned Reg)
void setNumLocals(size_t NumLocals)
void setVarargBufferVreg(unsigned Reg)
void setCFGStackified(bool Value=true)
unsigned getFrameBaseVreg() const
void setFrameBaseLocal(unsigned Local)
unsigned getVarargBufferVreg() const
bool isVRegStackified(Register VReg) const
unsigned getBasePointerVreg() const
const std::vector< MVT > & getLocals() const
void clearFrameBaseVreg()
void setWAReg(Register VReg, unsigned WAReg)
unsigned getWAReg(Register VReg) const
void initializeBaseYamlFields(MachineFunction &MF, const yaml::WebAssemblyFunctionInfo &YamlMFI)
bool isFrameBaseVirtual() const
void unstackifyVReg(Register VReg)
const std::vector< MVT > & getParams() const
void mapOptional(StringRef Key, T &Val)
static const unsigned UnusedReg
DenseMap< int, int > BBNumberMap
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)
ArrayRef(const T &OneElt) -> ArrayRef< T >
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)
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
static void mapping(IO &YamlIO, WebAssemblyFunctionInfo &MFI)
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
WebAssemblyFunctionInfo()=default
~WebAssemblyFunctionInfo() override=default
void mappingImpl(yaml::IO &YamlIO) override
std::vector< FlowStringValue > Results
std::vector< FlowStringValue > Params