#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "Utils/WebAssemblyTypeUtilities.h"
#include "WebAssembly.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblySubtarget.h"
#include "WebAssemblyTargetMachine.h"
#include "WebAssemblyUtilities.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/CodeGen/FastISel.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/PatternMatch.h"
usingnamespacellvm;
usingnamespacePatternMatch;
#define DEBUG_TYPE …
namespace {
class WebAssemblyFastISel final : public FastISel { … };
}
bool WebAssemblyFastISel::computeAddress(const Value *Obj, Address &Addr) { … }
void WebAssemblyFastISel::materializeLoadStoreOperands(Address &Addr) { … }
void WebAssemblyFastISel::addLoadStoreOperands(const Address &Addr,
const MachineInstrBuilder &MIB,
MachineMemOperand *MMO) { … }
unsigned WebAssemblyFastISel::maskI1Value(unsigned Reg, const Value *V) { … }
unsigned WebAssemblyFastISel::getRegForI1Value(const Value *V,
const BasicBlock *BB,
bool &Not) { … }
unsigned WebAssemblyFastISel::zeroExtendToI32(unsigned Reg, const Value *V,
MVT::SimpleValueType From) { … }
unsigned WebAssemblyFastISel::signExtendToI32(unsigned Reg, const Value *V,
MVT::SimpleValueType From) { … }
unsigned WebAssemblyFastISel::zeroExtend(unsigned Reg, const Value *V,
MVT::SimpleValueType From,
MVT::SimpleValueType To) { … }
unsigned WebAssemblyFastISel::signExtend(unsigned Reg, const Value *V,
MVT::SimpleValueType From,
MVT::SimpleValueType To) { … }
unsigned WebAssemblyFastISel::getRegForUnsignedValue(const Value *V) { … }
unsigned WebAssemblyFastISel::getRegForSignedValue(const Value *V) { … }
unsigned WebAssemblyFastISel::getRegForPromotedValue(const Value *V,
bool IsSigned) { … }
unsigned WebAssemblyFastISel::notValue(unsigned Reg) { … }
unsigned WebAssemblyFastISel::copyValue(unsigned Reg) { … }
unsigned WebAssemblyFastISel::fastMaterializeAlloca(const AllocaInst *AI) { … }
unsigned WebAssemblyFastISel::fastMaterializeConstant(const Constant *C) { … }
bool WebAssemblyFastISel::fastLowerArguments() { … }
bool WebAssemblyFastISel::selectCall(const Instruction *I) { … }
bool WebAssemblyFastISel::selectSelect(const Instruction *I) { … }
bool WebAssemblyFastISel::selectTrunc(const Instruction *I) { … }
bool WebAssemblyFastISel::selectZExt(const Instruction *I) { … }
bool WebAssemblyFastISel::selectSExt(const Instruction *I) { … }
bool WebAssemblyFastISel::selectICmp(const Instruction *I) { … }
bool WebAssemblyFastISel::selectFCmp(const Instruction *I) { … }
bool WebAssemblyFastISel::selectBitCast(const Instruction *I) { … }
bool WebAssemblyFastISel::selectLoad(const Instruction *I) { … }
bool WebAssemblyFastISel::selectStore(const Instruction *I) { … }
bool WebAssemblyFastISel::selectBr(const Instruction *I) { … }
bool WebAssemblyFastISel::selectRet(const Instruction *I) { … }
bool WebAssemblyFastISel::selectUnreachable(const Instruction *I) { … }
bool WebAssemblyFastISel::fastSelectInstruction(const Instruction *I) { … }
FastISel *WebAssembly::createFastISel(FunctionLoweringInfo &FuncInfo,
const TargetLibraryInfo *LibInfo) { … }