diff options
author | Wei Mi <wmi@google.com> | 2016-04-04 17:45:03 +0000 |
---|---|---|
committer | Wei Mi <wmi@google.com> | 2016-04-04 17:45:03 +0000 |
commit | fb5252cac1bd1feb22e8b30950f3b1c36e01bb44 (patch) | |
tree | 8e1f45d1ace28413bf00a4889e694ab89d84f3fe /llvm/include | |
parent | d575edb7801163ada155cebe601bb32eff8401cf (diff) | |
download | bcm5719-llvm-fb5252cac1bd1feb22e8b30950f3b1c36e01bb44.tar.gz bcm5719-llvm-fb5252cac1bd1feb22e8b30950f3b1c36e01bb44.zip |
Revert r265309 and r265312 because they caused some errors I need to investigate.
llvm-svn: 265317
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/CodeGen/LiveRangeEdit.h | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/llvm/include/llvm/CodeGen/LiveRangeEdit.h b/llvm/include/llvm/CodeGen/LiveRangeEdit.h index fdf7cbd47fc..2271e3352aa 100644 --- a/llvm/include/llvm/CodeGen/LiveRangeEdit.h +++ b/llvm/include/llvm/CodeGen/LiveRangeEdit.h @@ -72,10 +72,6 @@ private: /// ScannedRemattable - true when remattable values have been identified. bool ScannedRemattable; - /// DeadRemats - The saved instructions which have already been dead after - /// rematerialization but not deleted yet -- to be done in postOptimization. - SmallPtrSet<MachineInstr *, 32> *DeadRemats; - /// Remattable - Values defined by remattable instructions as identified by /// tii.isTriviallyReMaterializable(). SmallPtrSet<const VNInfo*,4> Remattable; @@ -120,16 +116,13 @@ public: /// @param vrm Map of virtual registers to physical registers for this /// function. If NULL, no virtual register map updates will /// be done. This could be the case if called before Regalloc. - /// @param deadRemats The collection of all the instructions defining an - /// original reg and are dead after remat. LiveRangeEdit(LiveInterval *parent, SmallVectorImpl<unsigned> &newRegs, MachineFunction &MF, LiveIntervals &lis, VirtRegMap *vrm, - Delegate *delegate = nullptr, - SmallPtrSet<MachineInstr *, 32> *deadRemats = nullptr) + Delegate *delegate = nullptr) : Parent(parent), NewRegs(newRegs), MRI(MF.getRegInfo()), LIS(lis), - VRM(vrm), TII(*MF.getSubtarget().getInstrInfo()), TheDelegate(delegate), - FirstNew(newRegs.size()), ScannedRemattable(false), - DeadRemats(deadRemats) { + VRM(vrm), TII(*MF.getSubtarget().getInstrInfo()), + TheDelegate(delegate), FirstNew(newRegs.size()), + ScannedRemattable(false) { MRI.setDelegate(this); } @@ -149,16 +142,6 @@ public: bool empty() const { return size() == 0; } unsigned get(unsigned idx) const { return NewRegs[idx+FirstNew]; } - /// pop_back - It allows LiveRangeEdit users to drop new registers. - /// The context is when an original def instruction of a register is - /// dead after rematerialization, we still want to keep it for following - /// rematerializations. We save the def instruction in DeadRemats, - /// and replace the original dst register with a new dummy register so - /// the live range of original dst register can be shrinked normally. - /// We don't want to allocate phys register for the dummy register, so - /// we want to drop it from the NewRegs set. - void pop_back() { NewRegs.pop_back(); } - ArrayRef<unsigned> regs() const { return makeArrayRef(NewRegs).slice(FirstNew); } @@ -192,15 +175,15 @@ public: /// Remat - Information needed to rematerialize at a specific location. struct Remat { VNInfo *ParentVNI; // parent_'s value at the remat location. - MachineInstr *OrigMI; // Instruction defining OrigVNI. It contains the - // real expr for remat. + MachineInstr *OrigMI; // Instruction defining ParentVNI. explicit Remat(VNInfo *ParentVNI) : ParentVNI(ParentVNI), OrigMI(nullptr) {} }; /// canRematerializeAt - Determine if ParentVNI can be rematerialized at /// UseIdx. It is assumed that parent_.getVNINfoAt(UseIdx) == ParentVNI. /// When cheapAsAMove is set, only cheap remats are allowed. - bool canRematerializeAt(Remat &RM, VNInfo *OrigVNI, SlotIndex UseIdx, + bool canRematerializeAt(Remat &RM, + SlotIndex UseIdx, bool cheapAsAMove); /// rematerializeAt - Rematerialize RM.ParentVNI into DestReg by inserting an @@ -225,12 +208,6 @@ public: return Rematted.count(ParentVNI); } - void markDeadRemat(MachineInstr *inst) { - // DeadRemats is an optional field. - if (DeadRemats) - DeadRemats->insert(inst); - } - /// eraseVirtReg - Notify the delegate that Reg is no longer in use, and try /// to erase it from LIS. void eraseVirtReg(unsigned Reg); @@ -241,11 +218,8 @@ public: /// RegsBeingSpilled lists registers currently being spilled by the register /// allocator. These registers should not be split into new intervals /// as currently those new intervals are not guaranteed to spill. - /// NoSplit indicates this func is used after the iterations of selectOrSplit - /// where registers should not be split into new intervals. - void eliminateDeadDefs(SmallVectorImpl<MachineInstr *> &Dead, - ArrayRef<unsigned> RegsBeingSpilled = None, - bool NoSplit = false); + void eliminateDeadDefs(SmallVectorImpl<MachineInstr*> &Dead, + ArrayRef<unsigned> RegsBeingSpilled = None); /// calculateRegClassAndHint - Recompute register class and hint for each new /// register. |