diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-02-27 06:40:41 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-02-27 06:40:41 +0000 |
commit | 3ac9cc615694361653d51148995f1fead69f9487 (patch) | |
tree | 940feeaeb882518bc7728d0809085607793097c2 /llvm/lib/CodeGen/LiveInterval.cpp | |
parent | 0bed1eab3937cc9c78baaef88ae85da9f3f91402 (diff) | |
download | llvm-3ac9cc615694361653d51148995f1fead69f9487.zip llvm-3ac9cc615694361653d51148995f1fead69f9487.tar.gz llvm-3ac9cc615694361653d51148995f1fead69f9487.tar.bz2 |
CodeGen: Take MachineInstr& in SlotIndexes and LiveIntervals, NFC
Take MachineInstr by reference instead of by pointer in SlotIndexes and
the SlotIndex wrappers in LiveIntervals. The MachineInstrs here are
never null, so this cleans up the API a bit. It also incidentally
removes a few implicit conversions from MachineInstrBundleIterator to
MachineInstr* (see PR26753).
At a couple of call sites it was convenient to convert to a range-based
for loop over MachineBasicBlock::instr_begin/instr_end, so I added
MachineBasicBlock::instrs.
llvm-svn: 262115
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index e639320..ab78072 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -1454,9 +1454,9 @@ void ConnectedVNInfoEqClasses::Distribute(LiveInterval &LI, LiveInterval *LIV[], // called, but it is not a requirement. SlotIndex Idx; if (MI->isDebugValue()) - Idx = LIS.getSlotIndexes()->getIndexBefore(MI); + Idx = LIS.getSlotIndexes()->getIndexBefore(*MI); else - Idx = LIS.getInstructionIndex(MI); + Idx = LIS.getInstructionIndex(*MI); LiveQueryResult LRQ = LI.Query(Idx); const VNInfo *VNI = MO.readsReg() ? LRQ.valueIn() : LRQ.valueDefined(); // In the case of an <undef> use that isn't tied to any def, VNI will be @@ -1563,7 +1563,7 @@ bool ConnectedSubRegClasses::findComponents(IntEqClasses &Classes, const LiveInterval::SubRange &SR = *SRInfo.SR; if ((SR.LaneMask & LaneMask) == 0) continue; - SlotIndex Pos = LIS.getInstructionIndex(MO.getParent()); + SlotIndex Pos = LIS.getInstructionIndex(*MO.getParent()); Pos = MO.isDef() ? Pos.getRegSlot(MO.isEarlyClobber()) : Pos.getBaseIndex(); const VNInfo *VNI = SR.getVNInfoAt(Pos); @@ -1598,7 +1598,7 @@ void ConnectedSubRegClasses::rewriteOperands(const IntEqClasses &Classes, MachineInstr &MI = *MO.getParent(); - SlotIndex Pos = LIS.getInstructionIndex(&MI); + SlotIndex Pos = LIS.getInstructionIndex(MI); unsigned SubRegIdx = MO.getSubReg(); LaneBitmask LaneMask = TRI.getSubRegIndexLaneMask(SubRegIdx); @@ -1672,12 +1672,12 @@ void ConnectedSubRegClasses::computeMainRangesFixFlags( // in and out of the instruction anymore. We need to add new dead and kill // flags in these cases. if (!MO.isUndef()) { - SlotIndex Pos = LIS.getInstructionIndex(MO.getParent()); + SlotIndex Pos = LIS.getInstructionIndex(*MO.getParent()); if (!LI->liveAt(Pos.getBaseIndex())) MO.setIsUndef(); } if (!MO.isDead()) { - SlotIndex Pos = LIS.getInstructionIndex(MO.getParent()); + SlotIndex Pos = LIS.getInstructionIndex(*MO.getParent()); if (!LI->liveAt(Pos.getDeadSlot())) MO.setIsDead(); } |