15 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H 16 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H 27 struct WebAssemblyFunctionInfo;
35 std::vector<MVT> Params;
37 std::vector<MVT> Locals;
40 std::vector<unsigned> WARegs;
53 unsigned VarargVreg = -1U;
57 unsigned BasePtrVreg = -1U;
68 const std::vector<MVT> &
getParams()
const {
return Params; }
81 const std::vector<MVT> &
getLocals()
const {
return Locals; }
84 assert(VarargVreg != -1U &&
"Vararg vreg hasn't been set");
90 assert(BasePtrVreg != -1U &&
"Base ptr vreg hasn't been set");
95 static const unsigned UnusedReg = -1u;
98 assert(MF.getRegInfo().getUniqueVRegDef(VReg));
100 if (I >= VRegStackified.
size())
101 VRegStackified.
resize(I + 1);
102 VRegStackified.
set(I);
106 if (
I < VRegStackified.
size())
111 if (
I >= VRegStackified.
size())
113 return VRegStackified.
test(
I);
118 assert(WAReg != UnusedReg);
132 return Reg & INT32_MAX;
151 std::unique_ptr<wasm::WasmSignature>
169 YamlIO.mapOptional(
"isCFGStackified", MFI.
CFGStackified,
false);
void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
static unsigned virtReg2Index(unsigned Reg)
Convert a virtual register number to a 0-based index.
unsigned getVarargBufferVreg() const
This class represents lattice values for constants.
const std::vector< MVT > & getLocals() const
bool test(unsigned Idx) const
Function Alias Analysis Results
void setWAReg(unsigned VReg, unsigned WAReg)
void computeSignatureVTs(const FunctionType *Ty, const Function &F, const TargetMachine &TM, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results)
unsigned getBasePointerVreg() const
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
static void mapping(IO &YamlIO, WebAssemblyFunctionInfo &MFI)
std::unique_ptr< wasm::WasmSignature > signatureFromMVTs(const SmallVectorImpl< MVT > &Results, const SmallVectorImpl< MVT > &Params)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void setCFGStackified(bool Value=true)
Class to represent function types.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool isVRegStackified(unsigned VReg) const
void setBasePointerVreg(unsigned Reg)
The instances of the Type class are immutable: once they are created, they are never changed...
This file provides WebAssembly-specific target descriptions.
void setNumLocals(size_t NumLocals)
WebAssemblyFunctionInfo(MachineFunction &MF)
void setVarargBufferVreg(unsigned Reg)
void stackifyVReg(unsigned VReg)
void setLocal(size_t i, MVT VT)
void unstackifyVReg(unsigned VReg)
void clearParamsAndResults()
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
bool isCFGStackified() const
size_type size() const
size - Returns the number of bits in this bitvector.
const std::vector< MVT > & getResults() const
unsigned getWAReg(unsigned VReg) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void valTypesFromMVTs(const ArrayRef< MVT > &In, SmallVectorImpl< wasm::ValType > &Out)
LLVM Value Representation.
void computeLegalValueVTs(const Function &F, const TargetMachine &TM, Type *Ty, SmallVectorImpl< MVT > &ValueVTs)
void mappingImpl(yaml::IO &YamlIO) override
WebAssemblyFunctionInfo()=default
Primary interface to the complete machine description for the target machine.
const std::vector< MVT > & getParams() const
~WebAssemblyFunctionInfo()=default
static unsigned getWARegStackId(unsigned Reg)