1 //===- ARMInstrInfo.cpp - ARM Instruction Information -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the ARM implementation of the TargetInstrInfo class.
12 //===----------------------------------------------------------------------===//
14 #include "ARMInstrInfo.h"
16 #include "ARMAddressingModes.h"
17 #include "ARMGenInstrInfo.inc"
18 #include "ARMMachineFunctionInfo.h"
19 #include "llvm/ADT/STLExtras.h"
20 #include "llvm/CodeGen/LiveVariables.h"
21 #include "llvm/CodeGen/MachineFrameInfo.h"
22 #include "llvm/CodeGen/MachineInstrBuilder.h"
23 #include "llvm/CodeGen/MachineJumpTableInfo.h"
24 #include "llvm/MC/MCAsmInfo.h"
27 ARMInstrInfo::ARMInstrInfo(const ARMSubtarget &STI)
28 : ARMBaseInstrInfo(STI), RI(*this, STI) {
31 unsigned ARMInstrInfo::getUnindexedOpcode(unsigned Opc) const {
64 reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
65 unsigned DestReg, unsigned SubIdx, const MachineInstr *Orig,
66 const TargetRegisterInfo *TRI) const {
67 DebugLoc dl = Orig->getDebugLoc();
68 unsigned Opcode = Orig->getOpcode();
72 case ARM::MOVi2pieces: {
73 RI.emitLoadConstPool(MBB, I, dl,
75 Orig->getOperand(1).getImm(),
76 (ARMCC::CondCodes)Orig->getOperand(2).getImm(),
77 Orig->getOperand(3).getReg());
78 MachineInstr *NewMI = prior(I);
79 NewMI->getOperand(0).setSubReg(SubIdx);
84 return ARMBaseInstrInfo::reMaterialize(MBB, I, DestReg, SubIdx, Orig, TRI);