//===-- 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 "regalloc"#include"llvm/CodeGen/LiveIntervalAnalysis.h"#include"llvm/Value.h"#include"llvm/Analysis/AliasAnalysis.h"#include"llvm/CodeGen/LiveVariables.h"#include"llvm/CodeGen/MachineDominators.h"#include"llvm/CodeGen/MachineInstr.h"#include"llvm/CodeGen/MachineRegisterInfo.h"#include"llvm/CodeGen/Passes.h"#include"llvm/Target/TargetRegisterInfo.h"#include"llvm/Target/TargetInstrInfo.h"#include"llvm/Target/TargetMachine.h"#include"llvm/Support/CommandLine.h"#include"llvm/Support/Debug.h"#include"llvm/Support/ErrorHandling.h"#include"llvm/Support/raw_ostream.h"#include"llvm/ADT/DenseSet.h"#include"llvm/ADT/STLExtras.h"#include"LiveRangeCalc.h"#include"VirtRegMap.h"#include<algorithm>#include<limits>#include<cmath>usingnamespacellvm;// Switch to the new experimental algorithm for computing live intervals.staticcl::opt<bool>NewLiveIntervals("new-live-intervals",cl::Hidden,cl::desc("Use new algorithm forcomputing live intervals"))