//===-- ARMISelDAGToDAG.cpp - A dag to dag inst selector for ARM ----------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file defines an instruction selector for the ARM target.////===----------------------------------------------------------------------===//#include"ARM.h"#include"ARMAddressingModes.h"#include"ARMConstantPoolValue.h"#include"ARMISelLowering.h"#include"ARMTargetMachine.h"#include"llvm/CallingConv.h"#include"llvm/Constants.h"#include"llvm/DerivedTypes.h"#include"llvm/Function.h"#include"llvm/Intrinsics.h"#include"llvm/LLVMContext.h"#include"llvm/CodeGen/MachineFrameInfo.h"#include"llvm/CodeGen/MachineFunction.h"#include"llvm/CodeGen/MachineInstrBuilder.h"#include"llvm/CodeGen/SelectionDAG.h"#include"llvm/CodeGen/SelectionDAGISel.h"#include"llvm/Target/TargetLowering.h"#include"llvm/Target/TargetOptions.h"#include"llvm/Support/Compiler.h"#include"llvm/Support/Debug.h"#include"llvm/Support/ErrorHandling.h"#include"llvm/Support/raw_ostream.h"usingnamespacellvm;staticconstunsignedarm_dsubreg_0=5;staticconstunsignedarm_dsubreg_1=6;//===--------------------------------------------------------------------===///// ARMDAGToDAGISel - ARM specific code to select ARM machine/// instructions for SelectionDAG operations.///namespace{classARMDAGToDAGISel:publicSelectionDAGISel{ARMBaseTargetMachine&TM;/// Subtarget - Keep a pointer to the ARMSubtarget around so that we can/// make the right decision when generating code for different targets.constARMSubtarget*Subtarget;public:explicitARMDAGToDAGISel(ARMBaseTargetMachine&tm):SelectionDAGISel(tm),TM(tm),Subtarget(&TM.getSubtarget<ARMSubtarget>()){}virtualconstchar*getPassName()const{return"ARM Instruction Selection";}/// getI32Imm - Return a target constant with the specified value, of type i32.inlineSDValuegetI32Imm(unsignedImm){returnCurDAG->getTargetConstant(Imm,MVT::i32);}SDNode*Select(SDValueOp);virtualvoidInstructionSelect();boolSelectShifterOperandReg(