This PR provides implementation of the basic codegen infra such as TargetFrameLowering, MCInstLower, AsmPrinter, RegisterInfo, InstructionInfo, TargetLowering, SelectionDAGISel. Migrated from https://reviews.llvm.org/D145658
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
//===- XtensaISelLowering.cpp - Xtensa DAG Lowering Implementation --------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines the interfaces that Xtensa uses to lower LLVM code into a
|
|
// selection DAG.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "XtensaISelLowering.h"
|
|
#include "XtensaSubtarget.h"
|
|
#include "XtensaTargetMachine.h"
|
|
#include "llvm/CodeGen/CallingConvLower.h"
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
|
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
|
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
|
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
|
|
#include "llvm/Support/Debug.h"
|
|
#include "llvm/Support/ErrorHandling.h"
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
using namespace llvm;
|
|
|
|
#define DEBUG_TYPE "xtensa-lower"
|
|
|
|
XtensaTargetLowering::XtensaTargetLowering(const TargetMachine &TM,
|
|
const XtensaSubtarget &STI)
|
|
: TargetLowering(TM), Subtarget(STI) {
|
|
// Set up the register classes.
|
|
addRegisterClass(MVT::i32, &Xtensa::ARRegClass);
|
|
|
|
// Set up special registers.
|
|
setStackPointerRegisterToSaveRestore(Xtensa::SP);
|
|
|
|
setSchedulingPreference(Sched::RegPressure);
|
|
|
|
setMinFunctionAlignment(Align(4));
|
|
|
|
// Compute derived properties from the register classes
|
|
computeRegisterProperties(STI.getRegisterInfo());
|
|
}
|
|
|
|
SDValue XtensaTargetLowering::LowerOperation(SDValue Op,
|
|
SelectionDAG &DAG) const {
|
|
switch (Op.getOpcode()) {
|
|
default:
|
|
report_fatal_error("Unexpected node to lower");
|
|
}
|
|
}
|
|
|
|
const char *XtensaTargetLowering::getTargetNodeName(unsigned Opcode) const {
|
|
return nullptr;
|
|
}
|