From be8f8c4478dee41e124650fa9d166eaf5dc6b2be Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 27 Feb 2016 20:14:29 +0000 Subject: CodeGen: Update LiveIntervalAnalysis API to use MachineInstr&, NFC These parameters aren't expected to be null, so take them by reference. llvm-svn: 262151 --- llvm/lib/CodeGen/StackSlotColoring.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/StackSlotColoring.cpp') diff --git a/llvm/lib/CodeGen/StackSlotColoring.cpp b/llvm/lib/CodeGen/StackSlotColoring.cpp index 51f4d0e6817..0ba90f343d6 100644 --- a/llvm/lib/CodeGen/StackSlotColoring.cpp +++ b/llvm/lib/CodeGen/StackSlotColoring.cpp @@ -145,9 +145,9 @@ void StackSlotColoring::ScanForSpillSlotRefs(MachineFunction &MF) { MachineBasicBlock *MBB = &*MBBI; for (MachineBasicBlock::iterator MII = MBB->begin(), EE = MBB->end(); MII != EE; ++MII) { - MachineInstr *MI = &*MII; - for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { - MachineOperand &MO = MI->getOperand(i); + MachineInstr &MI = *MII; + for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { + MachineOperand &MO = MI.getOperand(i); if (!MO.isFI()) continue; int FI = MO.getIndex(); @@ -156,11 +156,12 @@ void StackSlotColoring::ScanForSpillSlotRefs(MachineFunction &MF) { if (!LS->hasInterval(FI)) continue; LiveInterval &li = LS->getInterval(FI); - if (!MI->isDebugValue()) + if (!MI.isDebugValue()) li.weight += LiveIntervals::getSpillWeight(false, true, MBFI, MI); } - for (MachineInstr::mmo_iterator MMOI = MI->memoperands_begin(), - EE = MI->memoperands_end(); MMOI != EE; ++MMOI) { + for (MachineInstr::mmo_iterator MMOI = MI.memoperands_begin(), + EE = MI.memoperands_end(); + MMOI != EE; ++MMOI) { MachineMemOperand *MMO = *MMOI; if (const FixedStackPseudoSourceValue *FSV = dyn_cast_or_null( -- cgit v1.2.3