16 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H 17 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYMACHINEFUNCTIONINFO_H 31 std::vector<MVT> Params;
32 std::vector<MVT> Results;
33 std::vector<MVT> Locals;
36 std::vector<unsigned> WARegs;
49 unsigned VarargVreg = -1U;
53 unsigned BasePtrVreg = -1U;
60 const std::vector<MVT> &
getParams()
const {
return Params; }
63 const std::vector<MVT> &
getResults()
const {
return Results; }
73 const std::vector<MVT> &
getLocals()
const {
return Locals; }
76 assert(VarargVreg != -1U &&
"Vararg vreg hasn't been set");
82 assert(BasePtrVreg != -1U &&
"Base ptr vreg hasn't been set");
90 assert(MF.getRegInfo().getUniqueVRegDef(VReg));
92 if (I >= VRegStackified.
size())
93 VRegStackified.
resize(I + 1);
94 VRegStackified.
set(I);
98 if (
I >= VRegStackified.
size())
100 return VRegStackified.
test(
I);
105 assert(WAReg != UnusedReg);
119 return Reg & INT32_MAX;
135 std::unique_ptr<wasm::WasmSignature>
void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
unsigned getVarargBufferVreg() const
static unsigned virtReg2Index(unsigned Reg)
Convert a virtual register number to a 0-based index.
This class represents lattice values for constants.
const std::vector< MVT > & getLocals() const
bool test(unsigned Idx) const
void setWAReg(unsigned VReg, unsigned WAReg)
unsigned getBasePointerVreg() const
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
void ComputeLegalValueVTs(const Function &F, const TargetMachine &TM, Type *Ty, SmallVectorImpl< MVT > &ValueVTs)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
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)
std::unique_ptr< wasm::WasmSignature > SignatureFromMVTs(const SmallVectorImpl< MVT > &Results, const SmallVectorImpl< MVT > &Params)
WebAssemblyFunctionInfo(MachineFunction &MF)
void setVarargBufferVreg(unsigned Reg)
void stackifyVReg(unsigned VReg)
static const unsigned UnusedReg
void setLocal(size_t i, MVT VT)
void ComputeSignatureVTs(const FunctionType *Ty, const Function &F, const TargetMachine &TM, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results)
void clearParamsAndResults()
~WebAssemblyFunctionInfo() override
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
void ValTypesFromMVTs(const ArrayRef< MVT > &In, SmallVectorImpl< wasm::ValType > &Out)
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())
Primary interface to the complete machine description for the target machine.
const std::vector< MVT > & getParams() const
static unsigned getWARegStackId(unsigned Reg)