//===-- LiveIntervalAnalysis.cpp - Live Interval Analysis -----------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file implements the LiveInterval analysis pass which is used// by the Linear Scan Register allocator. This pass linearizes the// basic blocks of the function in DFS order and uses the// LiveVariables pass to conservatively compute live intervals for// each virtual and physical register.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "liveintervals"#include"llvm/CodeGen/LiveIntervalAnalysis.h"#include"VirtRegMap.h"#include"llvm/Value.h"#include"llvm/CodeGen/LiveVariables.h"#include"llvm/CodeGen/MachineFrameInfo.h"#include"llvm/CodeGen/MachineInstr.h"#include"llvm/CodeGen/MachineLoopInfo.h"#include"llvm/CodeGen/Passes.h"#include"llvm/CodeGen/SSARegMap.h"#include"llvm/Target/MRegisterInfo.h"#include"llvm/Target/TargetInstrInfo.h"#include"llvm/Target/TargetMachine.h"#include"llvm/Support/CommandLine.h"#include"llvm/Support/Debug.h"#include"llvm/ADT/Statistic.h"#include"llvm/ADT/STLExtras.h"#include<algorithm>#include<cmath>usingnamespacellvm;namespace{// Hidden options for help debugging.cl::opt<bool>DisableReMat("disable-rematerialization",cl::init(false),cl::Hidden);