#include "LanaiAluCode.h"
#include "LanaiMachineFunctionInfo.h"
#include "LanaiRegisterInfo.h"
#include "LanaiSubtarget.h"
#include "LanaiTargetMachine.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
usingnamespacellvm;
#define DEBUG_TYPE …
#define PASS_NAME …
namespace {
class LanaiDAGToDAGISel : public SelectionDAGISel { … };
bool canBeRepresentedAsSls(const ConstantSDNode &CN) { … }
class LanaiDAGToDAGISelLegacy : public SelectionDAGISelLegacy { … };
}
char LanaiDAGToDAGISelLegacy::ID = …;
INITIALIZE_PASS(…)
bool LanaiDAGToDAGISel::selectAddrSls(SDValue Addr, SDValue &Offset) { … }
bool LanaiDAGToDAGISel::selectAddrRiSpls(SDValue Addr, SDValue &Base,
SDValue &Offset, SDValue &AluOp,
bool RiMode) { … }
bool LanaiDAGToDAGISel::selectAddrRi(SDValue Addr, SDValue &Base,
SDValue &Offset, SDValue &AluOp) { … }
bool LanaiDAGToDAGISel::selectAddrSpls(SDValue Addr, SDValue &Base,
SDValue &Offset, SDValue &AluOp) { … }
namespace llvm {
namespace LPAC {
static AluCode isdToLanaiAluCode(ISD::NodeType Node_type) { … }
}
}
bool LanaiDAGToDAGISel::selectAddrRr(SDValue Addr, SDValue &R1, SDValue &R2,
SDValue &AluOp) { … }
bool LanaiDAGToDAGISel::SelectInlineAsmMemoryOperand(
const SDValue &Op, InlineAsm::ConstraintCode ConstraintCode,
std::vector<SDValue> &OutOps) { … }
void LanaiDAGToDAGISel::Select(SDNode *Node) { … }
void LanaiDAGToDAGISel::selectFrameIndex(SDNode *Node) { … }
FunctionPass *llvm::createLanaiISelDag(LanaiTargetMachine &TM) { … }