diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
| commit | 044eb2f6afba375a914ac9d8024f8f5142bb912e (patch) | |
| tree | 1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /lib/Target/Nios2/Nios2InstrInfo.cpp | |
| parent | eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff) | |
Notes
Diffstat (limited to 'lib/Target/Nios2/Nios2InstrInfo.cpp')
| -rw-r--r-- | lib/Target/Nios2/Nios2InstrInfo.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/Target/Nios2/Nios2InstrInfo.cpp b/lib/Target/Nios2/Nios2InstrInfo.cpp new file mode 100644 index 000000000000..df435d2715d7 --- /dev/null +++ b/lib/Target/Nios2/Nios2InstrInfo.cpp @@ -0,0 +1,43 @@ +//===-- Nios2InstrInfo.cpp - Nios2 Instruction Information ----------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the Nios2 implementation of the TargetInstrInfo class. +// +//===----------------------------------------------------------------------===// + +#include "Nios2InstrInfo.h" +#include "Nios2TargetMachine.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" + +using namespace llvm; + +#define GET_INSTRINFO_CTOR_DTOR +#include "Nios2GenInstrInfo.inc" + +// Pin the vtable to this file. +void Nios2InstrInfo::anchor() {} + +Nios2InstrInfo::Nios2InstrInfo(Nios2Subtarget &ST) + : Nios2GenInstrInfo(), RI(ST), Subtarget(ST) {} + +/// Expand Pseudo instructions into real backend instructions +bool Nios2InstrInfo::expandPostRAPseudo(MachineInstr &MI) const { + MachineBasicBlock &MBB = *MI.getParent(); + + switch (MI.getDesc().getOpcode()) { + default: + return false; + case Nios2::RetRA: + BuildMI(MBB, MI, MI.getDebugLoc(), get(Nios2::RET_R1)).addReg(Nios2::RA); + break; + } + + MBB.erase(MI); + return true; +} |
