//===-- SelectionDAGISel.cpp - Implement the SelectionDAGISel class -------===////// The LLVM Compiler Infrastructure//// This file was developed by the LLVM research group and is distributed under// the University of Illinois Open Source License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This implements the SelectionDAGISel class.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "isel"#include"llvm/CodeGen/SelectionDAGISel.h"#include"llvm/CallingConv.h"#include"llvm/Constants.h"#include"llvm/DerivedTypes.h"#include"llvm/Function.h"#include"llvm/Instructions.h"#include"llvm/Intrinsics.h"#include"llvm/CodeGen/IntrinsicLowering.h"#include"llvm/CodeGen/MachineFunction.h"#include"llvm/CodeGen/MachineFrameInfo.h"#include"llvm/CodeGen/MachineInstrBuilder.h"#include"llvm/CodeGen/SelectionDAG.h"#include"llvm/CodeGen/SSARegMap.h"#include"llvm/Target/MRegisterInfo.h"#include"llvm/Target/TargetData.h"#include"llvm/Target/TargetFrameInfo.h"#include"llvm/Target/TargetInstrInfo.h"#include"llvm/Target/TargetLowering.h"#include"llvm/Target/TargetMachine.h"#include"llvm/Transforms/Utils/BasicBlockUtils.h"#include"llvm/Support/CommandLine.h"#include"llvm/Support/MathExtras.h"#include"llvm/Support/Debug.h"#include<map>#include<iostream>usingnamespacellvm;#ifndef NDEBUGstaticcl::opt<bool>ViewDAGs("view-isel-dags",cl::Hidden,cl::desc("Pop up a window to show isel dags as they are selected"));#elsestaticconstboolViewDAGs=0;#endifnamespacellvm{//===--------------------------------------------------------------------===///// FunctionLoweringInfo - This contains information that is global to a/// function that is used when lowering a region of the function.classFunctionLoweringInfo{public:TargetLowering&TLI;Function&Fn;MachineFunction&MF;SSARegMap*RegMap;FunctionLoweringInfo(TargetLowering&TLI,Function&Fn,MachineFunction&MF);/// MBBMap - A mapping from LLVM basic blocks to the