#ifndef LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H
#define LLVM_CODEGEN_LIVEINTERVAL_ANALYSIS_H
-#include "llvm/ADT/DenseMap.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/LiveInterval.h"
+#include "llvm/ADT/IndexedMap.h"
namespace llvm {
typedef std::map<unsigned, LiveInterval> Reg2IntervalMap;
Reg2IntervalMap r2iMap_;
- typedef DenseMap<unsigned> Reg2RegMap;
+ typedef IndexedMap<unsigned> Reg2RegMap;
Reg2RegMap r2rMap_;
std::vector<bool> allocatableRegs_;
VirtRegMap& vrm,
int slot);
+ /// CreateNewLiveInterval - Create a new live interval with the given live
+ /// ranges. The new live interval will have an infinite spill weight.
+ LiveInterval &CreateNewLiveInterval(const LiveInterval *LI,
+ const std::vector<LiveRange> &LRs);
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual void releaseMemory();
/// print - Implement the dump method.
virtual void print(std::ostream &O, const Module* = 0) const;
+ void print(std::ostream *O, const Module* M = 0) const {
+ if (O) print(*O, M);
+ }
private:
/// RemoveMachineInstrFromMaps - This marks the specified machine instr as
}
}
- /// computeIntervals - Compute live intervals. This returns a vector of all
- /// the two-address instructions to the caller.
- void computeIntervals(std::vector<MachineInstr*> &TwoAddrInsts);
+ /// computeIntervals - Compute live intervals.
+ void computeIntervals();
/// joinIntervals - join compatible live intervals
void joinIntervals();
- /// HandleTwoAddressInsts - Arrange for the specified list of 2-addr
- /// instructions to have their src/dst regs allocated to the same register.
- void HandleTwoAddressInsts(const std::vector<MachineInstr*> &TwoAddrInsts);
-
/// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting
/// copies that cannot yet be coallesced into the "TryAgain" list.
void CopyCoallesceInMBB(MachineBasicBlock *MBB,