1 //===- IA64InstrInfo.cpp - IA64 Instruction Information -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the IA64 implementation of the TargetInstrInfo class.
12 //===----------------------------------------------------------------------===//
14 #include "IA64InstrInfo.h"
16 #include "IA64InstrBuilder.h"
17 #include "llvm/CodeGen/MachineInstrBuilder.h"
18 #include "IA64GenInstrInfo.inc"
21 IA64InstrInfo::IA64InstrInfo()
22 : TargetInstrInfo(IA64Insts, sizeof(IA64Insts)/sizeof(IA64Insts[0])) {
26 bool IA64InstrInfo::isMoveInstr(const MachineInstr& MI,
28 unsigned& destReg) const {
29 MachineOpCode oc = MI.getOpcode();
30 if (oc == IA64::MOV || oc == IA64::FMOV) {
31 // TODO: this doesn't detect predicate moves
32 assert(MI.getNumOperands() == 2 &&
33 /* MI.getOperand(0).isRegister() &&
34 MI.getOperand(1).isRegister() && */
35 "invalid register-register move instruction");
36 if( MI.getOperand(0).isRegister() &&
37 MI.getOperand(1).isRegister() ) {
38 // if both operands of the MOV/FMOV are registers, then
39 // yes, this is a move instruction
40 sourceReg = MI.getOperand(1).getReg();
41 destReg = MI.getOperand(0).getReg();
45 return false; // we don't consider e.g. %regN = MOV <FrameIndex #x> a