mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
081c2ca61f
This adds a basic tablegen backend that analyzes the SelectionDAG patterns to find simple ones that are eligible for GlobalISel-emission. That's similar to FastISel, with one notable difference: we're not fed ISD opcodes, so we need to map the SDNode operators to generic opcodes. That's done using GINodeEquiv in TargetGlobalISel.td. Otherwise, this is mostly boilerplate, and lots of filtering of any kind of "complicated" pattern. On AArch64, this is sufficient to match G_ADD up to s64 (to ADDWrr/ADDXrr) and G_BR (to B). Differential Revision: https://reviews.llvm.org/D26878 llvm-svn: 290284
48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
//===- AArch64InstructionSelector --------------------------------*- C++ -*-==//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
/// \file
|
|
/// This file declares the targeting of the InstructionSelector class for
|
|
/// AArch64.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64INSTRUCTIONSELECTOR_H
|
|
#define LLVM_LIB_TARGET_AARCH64_AARCH64INSTRUCTIONSELECTOR_H
|
|
|
|
#include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
|
|
|
|
namespace llvm {
|
|
class AArch64InstrInfo;
|
|
class AArch64RegisterBankInfo;
|
|
class AArch64RegisterInfo;
|
|
class AArch64Subtarget;
|
|
class AArch64TargetMachine;
|
|
|
|
class AArch64InstructionSelector : public InstructionSelector {
|
|
public:
|
|
AArch64InstructionSelector(const AArch64TargetMachine &TM,
|
|
const AArch64Subtarget &STI,
|
|
const AArch64RegisterBankInfo &RBI);
|
|
|
|
virtual bool select(MachineInstr &I) const override;
|
|
|
|
private:
|
|
/// tblgen-erated 'select' implementation, used as the initial selector for
|
|
/// the patterns that don't require complex C++.
|
|
bool selectImpl(MachineInstr &I) const;
|
|
|
|
const AArch64TargetMachine &TM;
|
|
const AArch64Subtarget &STI;
|
|
const AArch64InstrInfo &TII;
|
|
const AArch64RegisterInfo &TRI;
|
|
const AArch64RegisterBankInfo &RBI;
|
|
};
|
|
|
|
} // End llvm namespace.
|
|
#endif
|