//===-- LiveIntervalAnalysis.cpp - Live Interval Analysis -----------------===////// 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 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/Analysis/LoopInfo.h"#include"llvm/CodeGen/LiveVariables.h"#include"llvm/CodeGen/MachineFrameInfo.h"#include"llvm/CodeGen/MachineInstr.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;STATISTIC(numIntervals,"Number of original intervals");STATISTIC(numIntervalsAfter,"Number of intervals after coalesci