[llvm] r274904 - SelectionDAG: Avoid implicit iterator conversions in SelectionDAGISel, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 8 12:11:41 PDT 2016
Author: dexonsmith
Date: Fri Jul 8 14:11:40 2016
New Revision: 274904
URL: http://llvm.org/viewvc/llvm-project?rev=274904&view=rev
Log:
SelectionDAG: Avoid implicit iterator conversions in SelectionDAGISel, NFC
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=274904&r1=274903&r2=274904&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Jul 8 14:11:40 2016
@@ -1345,7 +1345,7 @@ void SelectionDAGISel::SelectAllBasicBlo
// where they are, so we can be sure to emit subsequent instructions
// after them.
if (FuncInfo->InsertPt != FuncInfo->MBB->begin())
- FastIS->setLastLocalValue(std::prev(FuncInfo->InsertPt));
+ FastIS->setLastLocalValue(&*std::prev(FuncInfo->InsertPt));
else
FastIS->setLastLocalValue(nullptr);
}
@@ -1499,15 +1499,15 @@ void SelectionDAGISel::SelectAllBasicBlo
/// terminator instructors so we can satisfy ABI constraints. A partial
/// terminator sequence is an improper subset of a terminator sequence (i.e. it
/// may be the whole terminator sequence).
-static bool MIIsInTerminatorSequence(const MachineInstr *MI) {
+static bool MIIsInTerminatorSequence(const MachineInstr &MI) {
// If we do not have a copy or an implicit def, we return true if and only if
// MI is a debug value.
- if (!MI->isCopy() && !MI->isImplicitDef())
+ if (!MI.isCopy() && !MI.isImplicitDef())
// Sometimes DBG_VALUE MI sneak in between the copies from the vregs to the
// physical registers if there is debug info associated with the terminator
// of our mbb. We want to include said debug info in our terminator
// sequence, so we return true in that case.
- return MI->isDebugValue();
+ return MI.isDebugValue();
// We have left the terminator sequence if we are not doing one of the
// following:
@@ -1517,18 +1517,18 @@ static bool MIIsInTerminatorSequence(con
// 3. Defining a register via an implicit def.
// OPI should always be a register definition...
- MachineInstr::const_mop_iterator OPI = MI->operands_begin();
+ MachineInstr::const_mop_iterator OPI = MI.operands_begin();
if (!OPI->isReg() || !OPI->isDef())
return false;
// Defining any register via an implicit def is always ok.
- if (MI->isImplicitDef())
+ if (MI.isImplicitDef())
return true;
// Grab the copy source...
MachineInstr::const_mop_iterator OPI2 = OPI;
++OPI2;
- assert(OPI2 != MI->operands_end()
+ assert(OPI2 != MI.operands_end()
&& "Should have a copy implying we should have 2 arguments.");
// Make sure that the copy dest is not a vreg when the copy source is a
@@ -1565,7 +1565,7 @@ FindSplitPointForStackProtector(MachineB
MachineBasicBlock::iterator Previous = SplitPoint;
--Previous;
- while (MIIsInTerminatorSequence(Previous)) {
+ while (MIIsInTerminatorSequence(*Previous)) {
SplitPoint = Previous;
if (Previous == Start)
break;
More information about the llvm-commits
mailing list