Index: include/llvm/CodeGen/MachineBasicBlock.h =================================================================== --- include/llvm/CodeGen/MachineBasicBlock.h +++ include/llvm/CodeGen/MachineBasicBlock.h @@ -693,7 +693,7 @@ bool IsCond); /// Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE - /// instructions. Return UnknownLoc if there is none. + /// and DBG_LABEL instructions. Return UnknownLoc if there is none. DebugLoc findDebugLoc(instr_iterator MBBI); DebugLoc findDebugLoc(iterator MBBI) { return findDebugLoc(MBBI.getInstrIterator()); @@ -890,7 +890,7 @@ /// const_instr_iterator} and the respective reverse iterators. template inline IterT skipDebugInstructionsForward(IterT It, IterT End) { - while (It != End && It->isDebugValue()) + while (It != End && It->isDebugInstr()) It++; return It; } @@ -901,7 +901,7 @@ /// const_instr_iterator} and the respective reverse iterators. template inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin) { - while (It != Begin && It->isDebugValue()) + while (It != Begin && It->isDebugInstr()) It--; return It; } Index: include/llvm/CodeGen/MachineInstrBuilder.h =================================================================== --- include/llvm/CodeGen/MachineInstrBuilder.h +++ include/llvm/CodeGen/MachineInstrBuilder.h @@ -220,6 +220,9 @@ assert((MI->isDebugValue() ? static_cast(MI->getDebugVariable()) : true) && "first MDNode argument of a DBG_VALUE not a variable"); + assert((MI->isDebugLabel() ? static_cast(MI->getDebugLabel()) + : true) && + "first MDNode argument of a DBG_LABEL not a label"); return *this; } Index: include/llvm/CodeGen/SlotIndexes.h =================================================================== --- include/llvm/CodeGen/SlotIndexes.h +++ include/llvm/CodeGen/SlotIndexes.h @@ -578,9 +578,9 @@ assert(!MI.isInsideBundle() && "Instructions inside bundles should use bundle start's slot."); assert(mi2iMap.find(&MI) == mi2iMap.end() && "Instr already indexed."); - // Numbering DBG_VALUE instructions could cause code generation to be + // Numbering debug instructions could cause code generation to be // affected by debug information. - assert(!MI.isDebugValue() && "Cannot number DBG_VALUE instructions."); + assert(!MI.isDebugInstr() && "Cannot number debug instructions."); assert(MI.getParent() != nullptr && "Instr must be added to function."); Index: lib/CodeGen/AggressiveAntiDepBreaker.cpp =================================================================== --- lib/CodeGen/AggressiveAntiDepBreaker.cpp +++ lib/CodeGen/AggressiveAntiDepBreaker.cpp @@ -808,7 +808,7 @@ I != E; --Count) { MachineInstr &MI = *--I; - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; DEBUG(dbgs() << "Anti: "); Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1042,7 +1042,7 @@ for (auto &MI : MBB) { // Print the assembly for the instruction. if (!MI.isPosition() && !MI.isImplicitDef() && !MI.isKill() && - !MI.isDebugValue()) { + !MI.isDebugInstr()) { HasAnyRealCode = true; ++NumInstsInFunction; } Index: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp =================================================================== --- lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -2522,8 +2522,8 @@ void CodeViewDebug::beginInstruction(const MachineInstr *MI) { DebugHandlerBase::beginInstruction(MI); - // Ignore DBG_VALUE locations and function prologue. - if (!Asm || !CurFn || MI->isDebugValue() || + // Ignore DBG_VALUE and DBG_LABEL locations and function prologue. + if (!Asm || !CurFn || MI->isDebugInstr() || MI->getFlag(MachineInstr::FrameSetup)) return; @@ -2532,7 +2532,7 @@ DebugLoc DL = MI->getDebugLoc(); if (!DL && MI->getParent() != PrevInstBB) { for (const auto &NextMI : *MI->getParent()) { - if (NextMI.isDebugValue()) + if (NextMI.isDebugInstr()) continue; DL = NextMI.getDebugLoc(); if (DL) Index: lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp +++ lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp @@ -198,7 +198,7 @@ RegDescribedVarsMap RegVars; for (const auto &MBB : *MF) { for (const auto &MI : MBB) { - if (!MI.isDebugValue()) { + if (!MI.isDebugInstr()) { // Not a DBG_VALUE instruction. It may clobber registers which describe // some variables. for (const MachineOperand &MO : MI.operands()) { @@ -234,6 +234,10 @@ continue; } + // Skip DBG_LABEL instructions. + if (MI.isDebugLabel()) + continue; + assert(MI.getNumOperands() > 1 && "Invalid DBG_VALUE instruction!"); // Use the base variable (without any DW_OP_piece expressions) // as index into History. The full variables including the Index: lib/CodeGen/BranchFolding.cpp =================================================================== --- lib/CodeGen/BranchFolding.cpp +++ lib/CodeGen/BranchFolding.cpp @@ -310,9 +310,9 @@ while (I1 != MBB1->begin() && I2 != MBB2->begin()) { --I1; --I2; // Skip debugging pseudos; necessary to avoid changing the code. - while (I1->isDebugValue()) { + while (I1->isDebugInstr()) { if (I1==MBB1->begin()) { - while (I2->isDebugValue()) { + while (I2->isDebugInstr()) { if (I2==MBB2->begin()) // I1==DBG at begin; I2==DBG at begin return TailLen; @@ -325,7 +325,7 @@ --I1; } // I1==first (untested) non-DBG preceding known match - while (I2->isDebugValue()) { + while (I2->isDebugInstr()) { if (I2==MBB2->begin()) { ++I1; // I1==non-DBG, or first of DBGs not at begin; I2==DBG at begin @@ -352,7 +352,7 @@ // I1==MBB1->begin() work as expected.) if (I1 == MBB1->begin() && I2 != MBB2->begin()) { --I2; - while (I2->isDebugValue()) { + while (I2->isDebugInstr()) { if (I2 == MBB2->begin()) return TailLen; --I2; @@ -361,7 +361,7 @@ } if (I2 == MBB2->begin() && I1 != MBB1->begin()) { --I1; - while (I1->isDebugValue()) { + while (I1->isDebugInstr()) { if (I1 == MBB1->begin()) return TailLen; --I1; @@ -454,7 +454,7 @@ MachineBasicBlock::iterator E) { unsigned Time = 0; for (; I != E; ++I) { - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (I->isCall()) Time += 10; @@ -814,12 +814,12 @@ assert(MBBI != MBBIE && "Reached BB end within common tail length!"); (void)MBBIE; - if (MBBI->isDebugValue()) { + if (MBBI->isDebugInstr()) { ++MBBI; continue; } - while ((MBBICommon != MBBIECommon) && MBBICommon->isDebugValue()) + while ((MBBICommon != MBBIECommon) && MBBICommon->isDebugInstr()) ++MBBICommon; assert(MBBICommon != MBBIECommon && @@ -859,7 +859,7 @@ } for (auto &MI : *MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; DebugLoc DL = MI.getDebugLoc(); for (unsigned int i = 0 ; i < NextCommonInsts.size() ; i++) { @@ -869,7 +869,7 @@ auto &Pos = NextCommonInsts[i]; assert(Pos != SameTails[i].getBlock()->end() && "Reached BB end within common tail"); - while (Pos->isDebugValue()) { + while (Pos->isDebugInstr()) { ++Pos; assert(Pos != SameTails[i].getBlock()->end() && "Reached BB end within common tail"); @@ -1416,7 +1416,7 @@ // Check if DBG_VALUE at the end of PrevBB is identical to the // DBG_VALUE at the beginning of MBB. while (PrevBBIter != PrevBB.begin() && MBBIter != MBB->end() - && PrevBBIter->isDebugValue() && MBBIter->isDebugValue()) { + && PrevBBIter->isDebugInstr() && MBBIter->isDebugInstr()) { if (!MBBIter->isIdenticalTo(*PrevBBIter)) break; MachineInstr &DuplicateDbg = *MBBIter; Index: lib/CodeGen/BreakFalseDeps.cpp =================================================================== --- lib/CodeGen/BreakFalseDeps.cpp +++ lib/CodeGen/BreakFalseDeps.cpp @@ -176,7 +176,7 @@ } void BreakFalseDeps::processDefs(MachineInstr *MI) { - assert(!MI->isDebugValue() && "Won't process debug values"); + assert(!MI->isDebugInstr() && "Won't process debug values"); // Break dependence on undef uses. Do this before updating LiveRegs below. unsigned OpNum; @@ -244,7 +244,7 @@ // and by then we'll have better information, so we can avoid doing the work // to try and break dependencies now. for (MachineInstr &MI : *MBB) { - if (!MI.isDebugValue()) + if (!MI.isDebugInstr()) processDefs(&MI); } processUndefReads(MBB); Index: lib/CodeGen/CalcSpillWeights.cpp =================================================================== --- lib/CodeGen/CalcSpillWeights.cpp +++ lib/CodeGen/CalcSpillWeights.cpp @@ -236,7 +236,7 @@ continue; numInstr++; - if (mi->isIdentityCopy() || mi->isImplicitDef() || mi->isDebugValue()) + if (mi->isIdentityCopy() || mi->isImplicitDef() || mi->isDebugInstr()) continue; if (!visited.insert(mi).second) continue; Index: lib/CodeGen/CriticalAntiDepBreaker.cpp =================================================================== --- lib/CodeGen/CriticalAntiDepBreaker.cpp +++ lib/CodeGen/CriticalAntiDepBreaker.cpp @@ -113,7 +113,7 @@ // FIXME: It may be possible to remove the isKill() restriction once PR18663 // has been properly fixed. There can be value in processing kills as seen in // the AggressiveAntiDepBreaker class. - if (MI.isDebugValue() || MI.isKill()) + if (MI.isDebugInstr() || MI.isKill()) return; assert(Count < InsertPosIndex && "Instruction index out of expected range!"); @@ -534,7 +534,7 @@ // FIXME: It may be possible to remove the isKill() restriction once PR18663 // has been properly fixed. There can be value in processing kills as seen // in the AggressiveAntiDepBreaker class. - if (MI.isDebugValue() || MI.isKill()) + if (MI.isDebugInstr() || MI.isKill()) continue; // Check if this instruction has a dependence on the critical path that Index: lib/CodeGen/EarlyIfConversion.cpp =================================================================== --- lib/CodeGen/EarlyIfConversion.cpp +++ lib/CodeGen/EarlyIfConversion.cpp @@ -195,7 +195,7 @@ // terminators never have side effects or define any used register values. for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->getFirstTerminator(); I != E; ++I) { - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (++InstrCount > BlockInstrLimit && !Stress) { Index: lib/CodeGen/ExecutionDomainFix.cpp =================================================================== --- lib/CodeGen/ExecutionDomainFix.cpp +++ lib/CodeGen/ExecutionDomainFix.cpp @@ -233,7 +233,7 @@ } void ExecutionDomainFix::processDefs(MachineInstr *MI, bool Kill) { - assert(!MI->isDebugValue() && "Won't process debug values"); + assert(!MI->isDebugInstr() && "Won't process debug values"); const MCInstrDesc &MCID = MI->getDesc(); for (unsigned i = 0, e = MI->isVariadic() ? MI->getNumOperands() : MCID.getNumDefs(); @@ -401,7 +401,7 @@ // and by then we'll have better information, so we can avoid doing the work // to try and break dependencies now. for (MachineInstr &MI : *TraversedMBB.MBB) { - if (!MI.isDebugValue()) { + if (!MI.isDebugInstr()) { bool Kill = false; if (TraversedMBB.PrimaryPass) Kill = visitInstr(&MI); Index: lib/CodeGen/IfConversion.cpp =================================================================== --- lib/CodeGen/IfConversion.cpp +++ lib/CodeGen/IfConversion.cpp @@ -948,7 +948,7 @@ BBI.ExtraCost2 = 0; BBI.ClobbersPred = false; for (MachineInstr &MI : make_range(Begin, End)) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; // It's unsafe to duplicate convergent instructions in this context, so set @@ -1723,12 +1723,12 @@ // Skip past the dups on each side separately since there may be // differing dbg_value entries. for (unsigned i = 0; i < NumDups1; ++DI1) { - if (!DI1->isDebugValue()) + if (!DI1->isDebugInstr()) ++i; } while (NumDups1 != 0) { ++DI2; - if (!DI2->isDebugValue()) + if (!DI2->isDebugInstr()) --NumDups1; } @@ -1757,7 +1757,7 @@ assert(DI1 != MBB1.begin()); --DI1; // skip dbg_value instructions - if (!DI1->isDebugValue()) + if (!DI1->isDebugInstr()) ++i; } MBB1.erase(DI1, MBB1.end()); @@ -1771,7 +1771,7 @@ do { assert(DI2 != MBB2.begin()); DI2--; - } while (DI2->isBranch() || DI2->isDebugValue()); + } while (DI2->isBranch() || DI2->isDebugInstr()); DI2++; } while (NumDups2 != 0) { @@ -1780,7 +1780,7 @@ assert(DI2 != MBB2.begin()); --DI2; // skip dbg_value instructions - if (!DI2->isDebugValue()) + if (!DI2->isDebugInstr()) --NumDups2; } @@ -1796,7 +1796,7 @@ SmallSet ExtUses; if (TII->isProfitableToUnpredicate(MBB1, MBB2)) { for (const MachineInstr &FI : make_range(MBB2.begin(), DI2)) { - if (FI.isDebugValue()) + if (FI.isDebugInstr()) continue; SmallVector Defs; for (const MachineOperand &MO : FI.operands()) { @@ -1985,7 +1985,7 @@ bool AnyUnpred = false; bool MaySpec = LaterRedefs != nullptr; for (MachineInstr &I : make_range(BBI.BB->begin(), E)) { - if (I.isDebugValue() || TII->isPredicated(I)) + if (I.isDebugInstr() || TII->isPredicated(I)) continue; // It may be possible not to predicate an instruction if it's the 'true' // side of a diamond and the 'false' side may re-define the instruction's @@ -2041,7 +2041,7 @@ ToBBI.ExtraCost += NumCycles-1; ToBBI.ExtraCost2 += ExtraPredCost; - if (!TII->isPredicated(I) && !MI->isDebugValue()) { + if (!TII->isPredicated(I) && !MI->isDebugInstr()) { if (!TII->PredicateInstruction(*MI, Cond)) { #ifndef NDEBUG dbgs() << "Unable to predicate " << I << "!\n"; Index: lib/CodeGen/InlineSpiller.cpp =================================================================== --- lib/CodeGen/InlineSpiller.cpp +++ lib/CodeGen/InlineSpiller.cpp @@ -616,7 +616,7 @@ MachineInstr &MI = *RegI++; // Debug values are not allowed to affect codegen. - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; anyRemat |= reMaterializeFor(LI, MI); @@ -931,7 +931,7 @@ MachineInstr *MI = &*(RegI++); // Debug values are not allowed to affect codegen. - if (MI->isDebugValue()) { + if (MI->isDebugInstr()) { // Modify DBG_VALUE now that the value is in a spill slot. MachineBasicBlock *MBB = MI->getParent(); DEBUG(dbgs() << "Modifying debug info due to spill:\t" << *MI); Index: lib/CodeGen/LiveIntervals.cpp =================================================================== --- lib/CodeGen/LiveIntervals.cpp +++ lib/CodeGen/LiveIntervals.cpp @@ -1390,7 +1390,7 @@ MachineBasicBlock::iterator Begin = MBB->begin(); while (MII != Begin) { - if ((--MII)->isDebugValue()) + if ((--MII)->isDebugInstr()) continue; SlotIndex Idx = Indexes->getInstructionIndex(*MII); @@ -1452,7 +1452,7 @@ for (MachineBasicBlock::iterator I = End; I != Begin;) { --I; MachineInstr &MI = *I; - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; SlotIndex instrIdx = getInstructionIndex(MI); @@ -1549,7 +1549,7 @@ for (MachineBasicBlock::iterator I = End; I != Begin;) { --I; MachineInstr &MI = *I; - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; for (MachineInstr::const_mop_iterator MOI = MI.operands_begin(), MOE = MI.operands_end(); Index: lib/CodeGen/LiveRangeShrink.cpp =================================================================== --- lib/CodeGen/LiveRangeShrink.cpp +++ lib/CodeGen/LiveRangeShrink.cpp @@ -130,7 +130,7 @@ for (MachineBasicBlock::iterator Next = MBB.begin(); Next != MBB.end();) { MachineInstr &MI = *Next; ++Next; - if (MI.isPHI() || MI.isDebugValue()) + if (MI.isPHI() || MI.isDebugInstr()) continue; if (MI.mayStore()) SawStore = true; @@ -218,7 +218,7 @@ if (DefMO && Insert && NumEligibleUse > 1 && Barrier <= IOM[Insert]) { MachineBasicBlock::iterator I = std::next(Insert->getIterator()); // Skip all the PHI and debug instructions. - while (I != MBB.end() && (I->isPHI() || I->isDebugValue())) + while (I != MBB.end() && (I->isPHI() || I->isDebugInstr())) I = std::next(I); if (I == MI.getIterator()) continue; Index: lib/CodeGen/LiveVariables.cpp =================================================================== --- lib/CodeGen/LiveVariables.cpp +++ lib/CodeGen/LiveVariables.cpp @@ -498,7 +498,7 @@ void LiveVariables::runOnInstr(MachineInstr &MI, SmallVectorImpl &Defs) { - assert(!MI.isDebugValue()); + assert(!MI.isDebugInstr()); // Process all of the operands of the instruction... unsigned NumOperandsToProcess = MI.getNumOperands(); @@ -575,7 +575,7 @@ DistanceMap.clear(); unsigned Dist = 0; for (MachineInstr &MI : *MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; DistanceMap.insert(std::make_pair(&MI, Dist++)); Index: lib/CodeGen/LocalStackSlotAllocation.cpp =================================================================== --- lib/CodeGen/LocalStackSlotAllocation.cpp +++ lib/CodeGen/LocalStackSlotAllocation.cpp @@ -304,7 +304,7 @@ for (MachineInstr &MI : BB) { // Debug value, stackmap and patchpoint instructions can't be out of // range, so they don't need any updates. - if (MI.isDebugValue() || MI.getOpcode() == TargetOpcode::STATEPOINT || + if (MI.isDebugInstr() || MI.getOpcode() == TargetOpcode::STATEPOINT || MI.getOpcode() == TargetOpcode::STACKMAP || MI.getOpcode() == TargetOpcode::PATCHPOINT) continue; Index: lib/CodeGen/MachineBasicBlock.cpp =================================================================== --- lib/CodeGen/MachineBasicBlock.cpp +++ lib/CodeGen/MachineBasicBlock.cpp @@ -173,7 +173,7 @@ const TargetInstrInfo *TII = getParent()->getSubtarget().getInstrInfo(); iterator E = end(); - while (I != E && (I->isPHI() || I->isPosition() || I->isDebugValue() || + while (I != E && (I->isPHI() || I->isPosition() || I->isDebugInstr() || TII->isBasicBlockPrologue(*I))) ++I; // FIXME: This needs to change if we wish to bundle labels / dbg_values @@ -186,7 +186,7 @@ MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() { iterator B = begin(), E = end(), I = E; - while (I != B && ((--I)->isTerminator() || I->isDebugValue())) + while (I != B && ((--I)->isTerminator() || I->isDebugInstr())) ; /*noop */ while (I != E && !I->isTerminator()) ++I; @@ -195,7 +195,7 @@ MachineBasicBlock::instr_iterator MachineBasicBlock::getFirstInstrTerminator() { instr_iterator B = instr_begin(), E = instr_end(), I = E; - while (I != B && ((--I)->isTerminator() || I->isDebugValue())) + while (I != B && ((--I)->isTerminator() || I->isDebugInstr())) ; /*noop */ while (I != E && !I->isTerminator()) ++I; @@ -213,7 +213,7 @@ while (I != B) { --I; // Return instruction that starts a bundle. - if (I->isDebugValue() || I->isInsideBundle()) + if (I->isDebugInstr() || I->isInsideBundle()) continue; return I; } @@ -1261,7 +1261,7 @@ if (MBBI == instr_begin()) return {}; // Skip debug declarations, we don't want a DebugLoc from them. MBBI = skipDebugInstructionsBackward(std::prev(MBBI), instr_begin()); - if (!MBBI->isDebugValue()) return MBBI->getDebugLoc(); + if (!MBBI->isDebugInstr()) return MBBI->getDebugLoc(); return {}; } Index: lib/CodeGen/MachineCSE.cpp =================================================================== --- lib/CodeGen/MachineCSE.cpp +++ lib/CodeGen/MachineCSE.cpp @@ -314,7 +314,7 @@ unsigned LookAheadLeft = LookAheadLimit; while (LookAheadLeft) { // Skip over dbg_value's. - while (I != E && I != EE && I->isDebugValue()) + while (I != E && I != EE && I->isDebugInstr()) ++I; if (I == EE) { @@ -353,7 +353,7 @@ bool MachineCSE::isCSECandidate(MachineInstr *MI) { if (MI->isPosition() || MI->isPHI() || MI->isImplicitDef() || MI->isKill() || - MI->isInlineAsm() || MI->isDebugValue()) + MI->isInlineAsm() || MI->isDebugInstr()) return false; // Ignore copies. Index: lib/CodeGen/MachineInstr.cpp =================================================================== --- lib/CodeGen/MachineInstr.cpp +++ lib/CodeGen/MachineInstr.cpp @@ -466,8 +466,8 @@ return false; } } - // If DebugLoc does not match then two dbg.values are not identical. - if (isDebugValue()) + // If DebugLoc does not match then two debug instructions are not identical. + if (isDebugInstr()) if (getDebugLoc() && Other.getDebugLoc() && getDebugLoc() != Other.getDebugLoc()) return false; @@ -974,7 +974,7 @@ return false; } - if (isPosition() || isDebugValue() || isTerminator() || + if (isPosition() || isDebugInstr() || isTerminator() || hasUnmodeledSideEffects()) return false; @@ -1501,6 +1501,7 @@ if (isIndirectDebugValue()) OS << " indirect"; } + // TODO: DBG_LABEL OS << '\n'; } Index: lib/CodeGen/MachineScheduler.cpp =================================================================== --- lib/CodeGen/MachineScheduler.cpp +++ lib/CodeGen/MachineScheduler.cpp @@ -271,7 +271,7 @@ MachineBasicBlock::const_iterator Beg) { assert(I != Beg && "reached the top of the region, cannot decrement"); while (--I != Beg) { - if (!I->isDebugValue()) + if (!I->isDebugInstr()) break; } return I; @@ -291,7 +291,7 @@ nextIfDebug(MachineBasicBlock::const_iterator I, MachineBasicBlock::const_iterator End) { for(; I != End; ++I) { - if (!I->isDebugValue()) + if (!I->isDebugInstr()) break; } return I; @@ -481,7 +481,7 @@ MachineInstr &MI = *std::prev(I); if (isSchedBoundary(&MI, &*MBB, MF, TII)) break; - if (!MI.isDebugValue()) + if (!MI.isDebugInstr()) // MBB::size() uses instr_iterator to count. Here we need a bundle to // count as a single instruction. ++NumRegionInstrs; @@ -1054,7 +1054,7 @@ ); assert((BotRPTracker.getPos() == RegionEnd || - (RegionEnd->isDebugValue() && + (RegionEnd->isDebugInstr() && BotRPTracker.getPos() == priorNonDebug(RegionEnd, RegionBegin))) && "Can't find the region bottom"); Index: lib/CodeGen/MachineSink.cpp =================================================================== --- lib/CodeGen/MachineSink.cpp +++ lib/CodeGen/MachineSink.cpp @@ -372,7 +372,7 @@ if (!ProcessedBegin) --I; - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; bool Joined = PerformTrivialForwardCoalescing(MI, &MBB); Index: lib/CodeGen/MachineTraceMetrics.cpp =================================================================== --- lib/CodeGen/MachineTraceMetrics.cpp +++ lib/CodeGen/MachineTraceMetrics.cpp @@ -653,7 +653,7 @@ SmallVectorImpl &Deps, const MachineRegisterInfo *MRI) { // Debug values should not be included in any calculations. - if (UseMI.isDebugValue()) + if (UseMI.isDebugInstr()) return false; bool HasPhysRegs = false; Index: lib/CodeGen/MachineVerifier.cpp =================================================================== --- lib/CodeGen/MachineVerifier.cpp +++ lib/CodeGen/MachineVerifier.cpp @@ -901,7 +901,7 @@ // Other instructions must have one, unless they are inside a bundle. if (LiveInts) { bool mapped = !LiveInts->isNotInMIMap(*MI); - if (MI->isDebugValue()) { + if (MI->isDebugInstr()) { if (mapped) report("Debug instruction has a slot index", MI); } else if (MI->isInsideBundle()) { Index: lib/CodeGen/PHIElimination.cpp =================================================================== --- lib/CodeGen/PHIElimination.cpp +++ lib/CodeGen/PHIElimination.cpp @@ -452,7 +452,7 @@ KillInst = FirstTerm; while (KillInst != opBlock.begin()) { --KillInst; - if (KillInst->isDebugValue()) + if (KillInst->isDebugInstr()) continue; if (KillInst->readsRegister(SrcReg)) break; @@ -512,7 +512,7 @@ KillInst = FirstTerm; while (KillInst != opBlock.begin()) { --KillInst; - if (KillInst->isDebugValue()) + if (KillInst->isDebugInstr()) continue; if (KillInst->readsRegister(SrcReg)) break; Index: lib/CodeGen/PeepholeOptimizer.cpp =================================================================== --- lib/CodeGen/PeepholeOptimizer.cpp +++ lib/CodeGen/PeepholeOptimizer.cpp @@ -1643,8 +1643,8 @@ ++MII; LocalMIs.insert(MI); - // Skip debug values. They should not affect this peephole optimization. - if (MI->isDebugValue()) + // Skip debug instructions. They should not affect this peephole optimization. + if (MI->isDebugInstr()) continue; if (MI->isPosition()) Index: lib/CodeGen/ReachingDefAnalysis.cpp =================================================================== --- lib/CodeGen/ReachingDefAnalysis.cpp +++ lib/CodeGen/ReachingDefAnalysis.cpp @@ -93,7 +93,7 @@ } void ReachingDefAnalysis::processDefs(MachineInstr *MI) { - assert(!MI->isDebugValue() && "Won't process debug values"); + assert(!MI->isDebugInstr() && "Won't process debug instructions"); unsigned MBBNumber = MI->getParent()->getNumber(); assert(MBBNumber < MBBReachingDefs.size() && @@ -125,7 +125,7 @@ const LoopTraversal::TraversedMBBInfo &TraversedMBB) { enterBasicBlock(TraversedMBB); for (MachineInstr &MI : *TraversedMBB.MBB) { - if (!MI.isDebugValue()) + if (!MI.isDebugInstr()) processDefs(&MI); } leaveBasicBlock(TraversedMBB); Index: lib/CodeGen/RegAllocFast.cpp =================================================================== --- lib/CodeGen/RegAllocFast.cpp +++ lib/CodeGen/RegAllocFast.cpp @@ -910,6 +910,9 @@ continue; } + if (MI.isDebugLabel()) + continue; + // If this is a copy, we may be able to coalesce. unsigned CopySrcReg = 0; unsigned CopyDstReg = 0; Index: lib/CodeGen/RegisterCoalescer.cpp =================================================================== --- lib/CodeGen/RegisterCoalescer.cpp +++ lib/CodeGen/RegisterCoalescer.cpp @@ -2578,7 +2578,7 @@ bool JoinVals::usesLanes(const MachineInstr &MI, unsigned Reg, unsigned SubIdx, LaneBitmask Lanes) const { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return false; for (const MachineOperand &MO : MI.operands()) { if (!MO.isReg() || MO.isDef() || MO.getReg() != Reg) Index: lib/CodeGen/RegisterPressure.cpp =================================================================== --- lib/CodeGen/RegisterPressure.cpp +++ lib/CodeGen/RegisterPressure.cpp @@ -747,7 +747,7 @@ /// instruction independent of liveness. void RegPressureTracker::recede(const RegisterOperands &RegOpers, SmallVectorImpl *LiveUses) { - assert(!CurrPos->isDebugValue()); + assert(!CurrPos->isDebugInstr()); // Boost pressure for all dead defs together. bumpDeadDefs(RegOpers.DeadDefs); @@ -1018,7 +1018,7 @@ /// This is intended for speculative queries. It leaves pressure inconsistent /// with the current position, so must be restored by the caller. void RegPressureTracker::bumpUpwardPressure(const MachineInstr *MI) { - assert(!MI->isDebugValue() && "Expect a nondebug instruction."); + assert(!MI->isDebugInstr() && "Expect a nondebug instruction."); SlotIndex SlotIdx; if (RequireIntervals) @@ -1259,7 +1259,7 @@ /// This is intended for speculative queries. It leaves pressure inconsistent /// with the current position, so must be restored by the caller. void RegPressureTracker::bumpDownwardPressure(const MachineInstr *MI) { - assert(!MI->isDebugValue() && "Expect a nondebug instruction."); + assert(!MI->isDebugInstr() && "Expect a nondebug instruction."); SlotIndex SlotIdx; if (RequireIntervals) Index: lib/CodeGen/RegisterScavenging.cpp =================================================================== --- lib/CodeGen/RegisterScavenging.cpp +++ lib/CodeGen/RegisterScavenging.cpp @@ -111,7 +111,7 @@ assert(Tracking && "Must be tracking to determine kills and defs"); MachineInstr &MI = *MBBI; - assert(!MI.isDebugValue() && "Debug values have no kills or defs"); + assert(!MI.isDebugInstr() && "Debug values have no kills or defs"); // Find out which registers are early clobbered, killed, defined, and marked // def-dead in this instruction. @@ -158,7 +158,7 @@ assert(Tracking && "Cannot unprocess because we're not tracking"); MachineInstr &MI = *MBBI; - if (!MI.isDebugValue()) { + if (!MI.isDebugInstr()) { determineKillsAndDefs(); // Commit the changes. @@ -195,7 +195,7 @@ I->Restore = nullptr; } - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return; determineKillsAndDefs(); @@ -318,7 +318,7 @@ bool inVirtLiveRange = false; for (++MI; InstrLimit > 0 && MI != ME; ++MI, --InstrLimit) { - if (MI->isDebugValue()) { + if (MI->isDebugInstr()) { ++InstrLimit; // Don't count debug instructions continue; } Index: lib/CodeGen/ScheduleDAGInstrs.cpp =================================================================== --- lib/CodeGen/ScheduleDAGInstrs.cpp +++ lib/CodeGen/ScheduleDAGInstrs.cpp @@ -532,7 +532,7 @@ SUnits.reserve(NumRegionInstrs); for (MachineInstr &MI : make_range(RegionBegin, RegionEnd)) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; SUnit *SU = newSUnit(&MI); @@ -763,6 +763,9 @@ DbgMI = &MI; continue; } + if (MI.isDebugLabel()) + continue; + SUnit *SU = MISUnitMap[&MI]; assert(SU && "No SUnit mapped to this MI"); @@ -1051,7 +1054,7 @@ // Examine block from end to start... for (MachineInstr &MI : make_range(MBB.rbegin(), MBB.rend())) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; // Update liveness. Registers that are defed but not used in this @@ -1087,7 +1090,7 @@ while (I->isBundledWithSucc()) ++I; do { - if (!I->isDebugValue()) + if (!I->isDebugInstr()) toggleKills(MRI, LiveRegs, *I, true); --I; } while(I != First); Index: lib/CodeGen/SlotIndexes.cpp =================================================================== --- lib/CodeGen/SlotIndexes.cpp +++ lib/CodeGen/SlotIndexes.cpp @@ -73,7 +73,7 @@ SlotIndex blockStartIndex(&indexList.back(), SlotIndex::Slot_Block); for (MachineInstr &MI : MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; // Insert a store index for the instr. @@ -244,7 +244,7 @@ for (MachineBasicBlock::iterator I = End; I != Begin;) { --I; MachineInstr &MI = *I; - if (!MI.isDebugValue() && mi2iMap.find(&MI) == mi2iMap.end()) + if (!MI.isDebugInstr() && mi2iMap.find(&MI) == mi2iMap.end()) insertMachineInstrInMaps(MI); } } Index: lib/CodeGen/SplitKit.cpp =================================================================== --- lib/CodeGen/SplitKit.cpp +++ lib/CodeGen/SplitKit.cpp @@ -859,7 +859,7 @@ MachineBasicBlock::iterator MBBI(MI); bool AtBegin; do AtBegin = MBBI == MBB->begin(); - while (!AtBegin && (--MBBI)->isDebugValue()); + while (!AtBegin && (--MBBI)->isDebugInstr()); DEBUG(dbgs() << "Removing " << Def << '\t' << *MI); LIS.removeVRegDefAt(*LI, Def); Index: lib/CodeGen/StackColoring.cpp =================================================================== --- lib/CodeGen/StackColoring.cpp +++ lib/CodeGen/StackColoring.cpp @@ -605,7 +605,7 @@ return true; } } else if (LifetimeStartOnFirstUse && !ProtectFromEscapedAllocas) { - if (!MI.isDebugValue()) { + if (!MI.isDebugInstr()) { bool found = false; for (const MachineOperand &MO : MI.operands()) { if (!MO.isFI()) @@ -999,7 +999,7 @@ bool TouchesMemory = I.mayLoad() || I.mayStore(); // If we *don't* protect the user from escaped allocas, don't bother // validating the instructions. - if (!I.isDebugValue() && TouchesMemory && ProtectFromEscapedAllocas) { + if (!I.isDebugInstr() && TouchesMemory && ProtectFromEscapedAllocas) { SlotIndex Index = Indexes->getInstructionIndex(I); const LiveInterval *Interval = &*Intervals[FromSlot]; assert(Interval->find(Index) != Interval->end() && @@ -1073,7 +1073,7 @@ for (MachineBasicBlock &BB : *MF) for (MachineInstr &I : BB) { if (I.getOpcode() == TargetOpcode::LIFETIME_START || - I.getOpcode() == TargetOpcode::LIFETIME_END || I.isDebugValue()) + I.getOpcode() == TargetOpcode::LIFETIME_END || I.isDebugInstr()) continue; // Some intervals are suspicious! In some cases we find address Index: lib/CodeGen/StackSlotColoring.cpp =================================================================== --- lib/CodeGen/StackSlotColoring.cpp +++ lib/CodeGen/StackSlotColoring.cpp @@ -421,7 +421,7 @@ if (!(LoadReg = TII->isLoadFromStackSlot(*I, FirstSS))) continue; // Skip the ...pseudo debugging... instructions between a load and store. - while ((NextMI != E) && NextMI->isDebugValue()) { + while ((NextMI != E) && NextMI->isDebugInstr()) { ++NextMI; ++I; } Index: lib/CodeGen/TwoAddressInstructionPass.cpp =================================================================== --- lib/CodeGen/TwoAddressInstructionPass.cpp +++ lib/CodeGen/TwoAddressInstructionPass.cpp @@ -290,8 +290,8 @@ unsigned NumVisited = 0; for (MachineInstr &OtherMI : make_range(std::next(OldPos), KillPos)) { - // DBG_VALUE cannot be counted against the limit. - if (OtherMI.isDebugValue()) + // Debug instructions cannot be counted against the limit. + if (OtherMI.isDebugInstr()) continue; if (NumVisited > 30) // FIXME: Arbitrary limit to reduce compile time cost. return false; @@ -940,8 +940,8 @@ MachineBasicBlock::iterator KillPos = KillMI; ++KillPos; for (MachineInstr &OtherMI : make_range(End, KillPos)) { - // DBG_VALUE cannot be counted against the limit. - if (OtherMI.isDebugValue()) + // Debug instructions cannot be counted against the limit. + if (OtherMI.isDebugInstr()) continue; if (NumVisited > 10) // FIXME: Arbitrary limit to reduce compile time cost. return false; @@ -985,7 +985,7 @@ } // Move debug info as well. - while (Begin != MBB->begin() && std::prev(Begin)->isDebugValue()) + while (Begin != MBB->begin() && std::prev(Begin)->isDebugInstr()) --Begin; nmi = End; @@ -1114,8 +1114,8 @@ unsigned NumVisited = 0; for (MachineInstr &OtherMI : make_range(mi, MachineBasicBlock::iterator(KillMI))) { - // DBG_VALUE cannot be counted against the limit. - if (OtherMI.isDebugValue()) + // Debug instructions cannot be counted against the limit. + if (OtherMI.isDebugInstr()) continue; if (NumVisited > 10) // FIXME: Arbitrary limit to reduce compile time cost. return false; @@ -1162,11 +1162,11 @@ // Move the old kill above MI, don't forget to move debug info as well. MachineBasicBlock::iterator InsertPos = mi; - while (InsertPos != MBB->begin() && std::prev(InsertPos)->isDebugValue()) + while (InsertPos != MBB->begin() && std::prev(InsertPos)->isDebugInstr()) --InsertPos; MachineBasicBlock::iterator From = KillMI; MachineBasicBlock::iterator To = std::next(From); - while (std::prev(From)->isDebugValue()) + while (std::prev(From)->isDebugInstr()) --From; MBB->splice(InsertPos, MBB, From, To); @@ -1699,7 +1699,7 @@ MachineBasicBlock::iterator nmi = std::next(mi); // Don't revisit an instruction previously converted by target. It may // contain undef register operands (%noreg), which are not handled. - if (mi->isDebugValue() || SunkInstrs.count(&*mi)) { + if (mi->isDebugInstr() || SunkInstrs.count(&*mi)) { mi = nmi; continue; } Index: lib/Target/AArch64/AArch64ConditionalCompares.cpp =================================================================== --- lib/Target/AArch64/AArch64ConditionalCompares.cpp +++ lib/Target/AArch64/AArch64ConditionalCompares.cpp @@ -392,7 +392,7 @@ // Check all instructions, except the terminators. It is assumed that // terminators never have side effects or define any used register values. for (auto &I : make_range(MBB->begin(), MBB->getFirstTerminator())) { - if (I.isDebugValue()) + if (I.isDebugInstr()) continue; if (++InstrCount > BlockInstrLimit && !Stress) { Index: lib/Target/AArch64/AArch64FrameLowering.cpp =================================================================== --- lib/Target/AArch64/AArch64FrameLowering.cpp +++ lib/Target/AArch64/AArch64FrameLowering.cpp @@ -162,7 +162,7 @@ // realistically that's not a big deal at this stage of the game. for (MachineBasicBlock &MBB : MF) { for (MachineInstr &MI : MBB) { - if (MI.isDebugValue() || MI.isPseudo() || + if (MI.isDebugInstr() || MI.isPseudo() || MI.getOpcode() == AArch64::ADDXri || MI.getOpcode() == AArch64::ADDSXri) continue; Index: lib/Target/AArch64/AArch64InstrInfo.cpp =================================================================== --- lib/Target/AArch64/AArch64InstrInfo.cpp +++ lib/Target/AArch64/AArch64InstrInfo.cpp @@ -5034,7 +5034,7 @@ return MachineOutlinerInstrType::Illegal; // Don't allow debug values to impact outlining type. - if (MI.isDebugValue() || MI.isIndirectDebugValue()) + if (MI.isDebugInstr() || MI.isIndirectDebugValue()) return MachineOutlinerInstrType::Invisible; // At this point, KILL instructions don't really tell us much so we can go Index: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp =================================================================== --- lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp +++ lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp @@ -511,7 +511,7 @@ // TODO: CodeSize should account for multiple functions. // TODO: Should we count size of debug info? - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; CodeSize += TII->getInstSizeInBytes(MI); @@ -650,7 +650,7 @@ continue; case AMDGPU::NoRegister: - assert(MI.isDebugValue()); + assert(MI.isDebugInstr()); continue; case AMDGPU::VCC: Index: lib/Target/AMDGPU/GCNHazardRecognizer.cpp =================================================================== --- lib/Target/AMDGPU/GCNHazardRecognizer.cpp +++ lib/Target/AMDGPU/GCNHazardRecognizer.cpp @@ -634,7 +634,7 @@ } int GCNHazardRecognizer::checkAnyInstHazards(MachineInstr *MI) { - if (MI->isDebugValue()) + if (MI->isDebugInstr()) return 0; const SIRegisterInfo *TRI = ST.getRegisterInfo(); Index: lib/Target/AMDGPU/GCNIterativeScheduler.cpp =================================================================== --- lib/Target/AMDGPU/GCNIterativeScheduler.cpp +++ lib/Target/AMDGPU/GCNIterativeScheduler.cpp @@ -68,14 +68,14 @@ auto I = Begin; MaxInstNum = std::max(MaxInstNum, 1u); for (; I != End && MaxInstNum; ++I, --MaxInstNum) { - if (!I->isDebugValue() && LIS) + if (!I->isDebugInstr() && LIS) OS << LIS->getInstructionIndex(*I); OS << '\t' << *I; } if (I != End) { OS << "\t...\n"; I = std::prev(End); - if (!I->isDebugValue() && LIS) + if (!I->isDebugInstr() && LIS) OS << LIS->getInstructionIndex(*I); OS << '\t' << *I; } @@ -383,10 +383,10 @@ if (MI != &*Top) { BB->remove(MI); BB->insert(Top, MI); - if (!MI->isDebugValue()) + if (!MI->isDebugInstr()) LIS->handleMove(*MI, true); } - if (!MI->isDebugValue()) { + if (!MI->isDebugInstr()) { // Reset read - undef flags and update them later. for (auto &Op : MI->operands()) if (Op.isReg() && Op.isDef()) Index: lib/Target/AMDGPU/GCNRegPressure.cpp =================================================================== --- lib/Target/AMDGPU/GCNRegPressure.cpp +++ lib/Target/AMDGPU/GCNRegPressure.cpp @@ -300,7 +300,7 @@ LastTrackedMI = &MI; - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return; auto const RegUses = collectVirtualRegUses(MI, LIS, *MRI); Index: lib/Target/AMDGPU/GCNSchedStrategy.cpp =================================================================== --- lib/Target/AMDGPU/GCNSchedStrategy.cpp +++ lib/Target/AMDGPU/GCNSchedStrategy.cpp @@ -388,13 +388,13 @@ DEBUG(dbgs() << "Attempting to revert scheduling.\n"); RegionEnd = RegionBegin; for (MachineInstr *MI : Unsched) { - if (MI->isDebugValue()) + if (MI->isDebugInstr()) continue; if (MI->getIterator() != RegionEnd) { BB->remove(MI); BB->insert(RegionEnd, MI); - if (!MI->isDebugValue()) + if (!MI->isDebugInstr()) LIS->handleMove(*MI, true); } // Reset read-undef flags and update them later. @@ -403,7 +403,7 @@ Op.setIsUndef(false); RegisterOperands RegOpers; RegOpers.collect(*MI, *TRI, MRI, ShouldTrackLaneMasks, false); - if (!MI->isDebugValue()) { + if (!MI->isDebugInstr()) { if (ShouldTrackLaneMasks) { // Adjust liveness and add missing dead+read-undef flags. SlotIndex SlotIdx = LIS->getInstructionIndex(*MI).getRegSlot(); Index: lib/Target/AMDGPU/SIDebuggerInsertNops.cpp =================================================================== --- lib/Target/AMDGPU/SIDebuggerInsertNops.cpp +++ lib/Target/AMDGPU/SIDebuggerInsertNops.cpp @@ -78,8 +78,8 @@ for (auto &MBB : MF) { for (auto MI = MBB.begin(); MI != MBB.end(); ++MI) { - // Skip DBG_VALUE instructions and instructions without location. - if (MI->isDebugValue() || !MI->getDebugLoc()) + // Skip debug instructions and instructions without location. + if (MI->isDebugInstr() || !MI->getDebugLoc()) continue; // Insert nop instruction if line number does not have nop inserted. Index: lib/Target/AMDGPU/SIInsertWaitcnts.cpp =================================================================== --- lib/Target/AMDGPU/SIInsertWaitcnts.cpp +++ lib/Target/AMDGPU/SIInsertWaitcnts.cpp @@ -835,7 +835,7 @@ // sc-merge. It is not a coincident that all these cases correspond to the // instructions that are skipped in the assembling loop. bool NeedLineMapping = false; // TODO: Check on this. - if (MI.isDebugValue() && + if (MI.isDebugInstr() && // TODO: any other opcode? !NeedLineMapping) { return; Index: lib/Target/AMDGPU/SIMachineScheduler.cpp =================================================================== --- lib/Target/AMDGPU/SIMachineScheduler.cpp +++ lib/Target/AMDGPU/SIMachineScheduler.cpp @@ -1274,7 +1274,7 @@ nextIfDebug(MachineBasicBlock::iterator I, MachineBasicBlock::const_iterator End) { for (; I != End; ++I) { - if (!I->isDebugValue()) + if (!I->isDebugInstr()) break; } return I; Index: lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp =================================================================== --- lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp +++ lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp @@ -134,7 +134,7 @@ } while (I != E) { - if (I->isDebugValue()) { + if (I->isDebugInstr()) { I = std::next(I); continue; } Index: lib/Target/ARC/ARCInstrInfo.cpp =================================================================== --- lib/Target/ARC/ARCInstrInfo.cpp +++ lib/Target/ARC/ARCInstrInfo.cpp @@ -173,7 +173,7 @@ bool CantAnalyze = false; // Skip over DEBUG values and predicated nonterminators. - while (I->isDebugValue() || !I->isTerminator()) { + while (I->isDebugInstr() || !I->isTerminator()) { if (I == MBB.begin()) return false; --I; Index: lib/Target/ARM/ARMBaseInstrInfo.cpp =================================================================== --- lib/Target/ARM/ARMBaseInstrInfo.cpp +++ lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -331,7 +331,7 @@ bool CantAnalyze = false; // Skip over DEBUG values and predicated nonterminators. - while (I->isDebugValue() || !I->isTerminator()) { + while (I->isDebugInstr() || !I->isTerminator()) { if (I == MBB.begin()) return false; --I; @@ -1815,7 +1815,7 @@ // considered a scheduling hazard, which is wrong. It should be the actual // instruction preceding the dbg_value instruction(s), just like it is // when debug info is not present. - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return false; // Terminators and labels can't be scheduled around. @@ -1829,8 +1829,8 @@ // to the t2IT instruction. The added compile time and complexity does not // seem worth it. MachineBasicBlock::const_iterator I = MI; - // Make sure to skip any dbg_value instructions - while (++I != MBB->end() && I->isDebugValue()) + // Make sure to skip any debug instructions + while (++I != MBB->end() && I->isDebugInstr()) ; if (I != MBB->end() && I->getOpcode() == ARM::t2IT) return true; Index: lib/Target/ARM/ARMConstantIslandPass.cpp =================================================================== --- lib/Target/ARM/ARMConstantIslandPass.cpp +++ lib/Target/ARM/ARMConstantIslandPass.cpp @@ -700,7 +700,7 @@ WaterList.push_back(&MBB); for (MachineInstr &I : MBB) { - if (I.isDebugValue()) + if (I.isDebugInstr()) continue; unsigned Opc = I.getOpcode(); Index: lib/Target/ARM/ARMHazardRecognizer.cpp =================================================================== --- lib/Target/ARM/ARMHazardRecognizer.cpp +++ lib/Target/ARM/ARMHazardRecognizer.cpp @@ -37,7 +37,7 @@ MachineInstr *MI = SU->getInstr(); - if (!MI->isDebugValue()) { + if (!MI->isDebugInstr()) { // Look for special VMLA / VMLS hazards. A VMUL / VADD / VSUB following // a VMLA / VMLS will cause 4 cycle stall. const MCInstrDesc &MCID = MI->getDesc(); @@ -81,7 +81,7 @@ void ARMHazardRecognizer::EmitInstruction(SUnit *SU) { MachineInstr *MI = SU->getInstr(); - if (!MI->isDebugValue()) { + if (!MI->isDebugInstr()) { LastMI = MI; FpMLxStalls = 0; } Index: lib/Target/ARM/ARMLoadStoreOptimizer.cpp =================================================================== --- lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -1198,7 +1198,7 @@ // Skip debug values. MachineBasicBlock::iterator PrevMBBI = std::prev(MBBI); - while (PrevMBBI->isDebugValue() && PrevMBBI != BeginMBBI) + while (PrevMBBI->isDebugInstr() && PrevMBBI != BeginMBBI) --PrevMBBI; Offset = isIncrementOrDecrement(*PrevMBBI, Reg, Pred, PredReg); @@ -1214,7 +1214,7 @@ MachineBasicBlock::iterator EndMBBI = MBB.end(); MachineBasicBlock::iterator NextMBBI = std::next(MBBI); // Skip debug values. - while (NextMBBI != EndMBBI && NextMBBI->isDebugValue()) + while (NextMBBI != EndMBBI && NextMBBI->isDebugInstr()) ++NextMBBI; if (NextMBBI == EndMBBI) return EndMBBI; @@ -1807,7 +1807,7 @@ MBBI = I; --Position; // Fallthrough to look into existing chain. - } else if (MBBI->isDebugValue()) { + } else if (MBBI->isDebugInstr()) { continue; } else if (MBBI->getOpcode() == ARM::t2LDRDi8 || MBBI->getOpcode() == ARM::t2STRDi8) { @@ -1891,8 +1891,8 @@ MBBI->getOpcode() == ARM::tBX_RET || MBBI->getOpcode() == ARM::MOVPCLR)) { MachineBasicBlock::iterator PrevI = std::prev(MBBI); - // Ignore any DBG_VALUE instructions. - while (PrevI->isDebugValue() && PrevI != MBB.begin()) + // Ignore any debug instructions. + while (PrevI->isDebugInstr() && PrevI != MBB.begin()) --PrevI; MachineInstr &PrevMI = *PrevI; unsigned Opcode = PrevMI.getOpcode(); @@ -2063,7 +2063,7 @@ // Are there stores / loads / calls between them? SmallSet AddedRegPressure; while (++I != E) { - if (I->isDebugValue() || MemOps.count(&*I)) + if (I->isDebugInstr() || MemOps.count(&*I)) continue; if (I->isCall() || I->isTerminator() || I->hasUnmodeledSideEffects()) return false; @@ -2253,7 +2253,7 @@ // This is the new location for the loads / stores. MachineBasicBlock::iterator InsertPos = isLd ? FirstOp : LastOp; while (InsertPos != MBB->end() && - (MemOps.count(&*InsertPos) || InsertPos->isDebugValue())) + (MemOps.count(&*InsertPos) || InsertPos->isDebugInstr())) ++InsertPos; // If we are moving a pair of loads / stores, see if it makes sense @@ -2355,7 +2355,7 @@ break; } - if (!MI.isDebugValue()) + if (!MI.isDebugInstr()) MI2LocMap[&MI] = ++Loc; if (!isMemoryOp(MI)) Index: lib/Target/ARM/Thumb2ITBlockPass.cpp =================================================================== --- lib/Target/ARM/Thumb2ITBlockPass.cpp +++ lib/Target/ARM/Thumb2ITBlockPass.cpp @@ -183,7 +183,7 @@ // If not, then there is nothing to be gained by moving the copy. MachineBasicBlock::iterator I = MI; ++I; MachineBasicBlock::iterator E = MI->getParent()->end(); - while (I != E && I->isDebugValue()) + while (I != E && I->isDebugInstr()) ++I; if (I != E) { unsigned NPredReg = 0; @@ -237,7 +237,7 @@ // block so check the instruction we just put in the block. for (; MBBI != E && Pos && (!MI->isBranch() && !MI->isReturn()) ; ++MBBI) { - if (MBBI->isDebugValue()) + if (MBBI->isDebugInstr()) continue; MachineInstr *NMI = &*MBBI; Index: lib/Target/ARM/Thumb2InstrInfo.cpp =================================================================== --- lib/Target/ARM/Thumb2InstrInfo.cpp +++ lib/Target/ARM/Thumb2InstrInfo.cpp @@ -82,7 +82,7 @@ MachineBasicBlock::iterator E = MBB->begin(); unsigned Count = 4; // At most 4 instructions in an IT block. while (Count && MBBI != E) { - if (MBBI->isDebugValue()) { + if (MBBI->isDebugInstr()) { --MBBI; continue; } @@ -109,7 +109,7 @@ bool Thumb2InstrInfo::isLegalToSplitMBBAt(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) const { - while (MBBI->isDebugValue()) { + while (MBBI->isDebugInstr()) { ++MBBI; if (MBBI == MBB.end()) return false; Index: lib/Target/ARM/Thumb2SizeReduction.cpp =================================================================== --- lib/Target/ARM/Thumb2SizeReduction.cpp +++ lib/Target/ARM/Thumb2SizeReduction.cpp @@ -1033,7 +1033,7 @@ BundleMI = MI; continue; } - if (MI->isDebugValue()) + if (MI->isDebugInstr()) continue; LiveCPSR = UpdateCPSRUse(*MI, LiveCPSR); Index: lib/Target/ARM/ThumbRegisterInfo.cpp =================================================================== --- lib/Target/ARM/ThumbRegisterInfo.cpp +++ lib/Target/ARM/ThumbRegisterInfo.cpp @@ -475,7 +475,7 @@ // before that instead and adjust the UseMI. bool done = false; for (MachineBasicBlock::iterator II = I; !done && II != UseMI ; ++II) { - if (II->isDebugValue()) + if (II->isDebugInstr()) continue; // If this instruction affects R12, adjust our restore point. for (unsigned i = 0, e = II->getNumOperands(); i != e; ++i) { Index: lib/Target/AVR/AVRInstrInfo.cpp =================================================================== --- lib/Target/AVR/AVRInstrInfo.cpp +++ lib/Target/AVR/AVRInstrInfo.cpp @@ -273,7 +273,7 @@ while (I != MBB.begin()) { --I; - if (I->isDebugValue()) { + if (I->isDebugInstr()) { continue; } @@ -444,7 +444,7 @@ while (I != MBB.begin()) { --I; - if (I->isDebugValue()) { + if (I->isDebugInstr()) { continue; } //:TODO: add here the missing jmp instructions once they are implemented Index: lib/Target/BPF/BPFInstrInfo.cpp =================================================================== --- lib/Target/BPF/BPFInstrInfo.cpp +++ lib/Target/BPF/BPFInstrInfo.cpp @@ -93,7 +93,7 @@ MachineBasicBlock::iterator I = MBB.end(); while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; // Working from the bottom, when we see a non-terminator @@ -168,7 +168,7 @@ while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (I->getOpcode() != BPF::JMP) break; Index: lib/Target/Hexagon/BitTracker.cpp =================================================================== --- lib/Target/Hexagon/BitTracker.cpp +++ lib/Target/Hexagon/BitTracker.cpp @@ -843,7 +843,7 @@ void BT::visitNonBranch(const MachineInstr &MI) { if (Trace) dbgs() << "Visit MI(" << printMBBReference(*MI.getParent()) << "): " << MI; - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return; assert(!MI.isBranch() && "Unexpected branch instruction"); Index: lib/Target/Hexagon/HexagonAsmPrinter.cpp =================================================================== --- lib/Target/Hexagon/HexagonAsmPrinter.cpp +++ lib/Target/Hexagon/HexagonAsmPrinter.cpp @@ -753,7 +753,7 @@ MachineBasicBlock::const_instr_iterator MII = MI->getIterator(); for (++MII; MII != MBB->instr_end() && MII->isInsideBundle(); ++MII) - if (!MII->isDebugValue() && !MII->isImplicitDef()) + if (!MII->isDebugInstr() && !MII->isImplicitDef()) HexagonLowerToMC(MCII, &*MII, MCB, *this); } else Index: lib/Target/Hexagon/HexagonBlockRanges.cpp =================================================================== --- lib/Target/Hexagon/HexagonBlockRanges.cpp +++ lib/Target/Hexagon/HexagonBlockRanges.cpp @@ -160,7 +160,7 @@ IndexType Idx = IndexType::First; First = Idx; for (auto &In : B) { - if (In.isDebugValue()) + if (In.isDebugInstr()) continue; assert(getIndex(&In) == IndexType::None && "Instruction already in map"); Map.insert(std::make_pair(Idx, &In)); @@ -314,7 +314,7 @@ RegisterSet Defs, Clobbers; for (auto &In : B) { - if (In.isDebugValue()) + if (In.isDebugInstr()) continue; IndexType Index = IndexMap.getIndex(&In); // Process uses first. Index: lib/Target/Hexagon/HexagonConstPropagation.cpp =================================================================== --- lib/Target/Hexagon/HexagonConstPropagation.cpp +++ lib/Target/Hexagon/HexagonConstPropagation.cpp @@ -799,7 +799,7 @@ SetVector &Targets) { MachineBasicBlock::const_iterator FirstBr = MB->end(); for (const MachineInstr &MI : *MB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; if (MI.isBranch()) { FirstBr = MI.getIterator(); @@ -814,7 +814,7 @@ for (MachineBasicBlock::const_iterator I = FirstBr; I != End; ++I) { const MachineInstr &MI = *I; // Can there be debug instructions between branches? - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; if (!InstrExec.count(&MI)) continue; @@ -896,7 +896,7 @@ // If the successor block just became executable, visit all instructions. // To see if this is the first time we're visiting it, check the first // non-debug instruction to see if it is executable. - while (It != End && It->isDebugValue()) + while (It != End && It->isDebugInstr()) ++It; assert(It == End || !It->isPHI()); // If this block has been visited, go on to the next one. @@ -905,7 +905,7 @@ // For now, scan all non-branch instructions. Branches require different // processing. while (It != End && !It->isBranch()) { - if (!It->isDebugValue()) { + if (!It->isDebugInstr()) { InstrExec.insert(&*It); visitNonBranch(*It); } Index: lib/Target/Hexagon/HexagonCopyToCombine.cpp =================================================================== --- lib/Target/Hexagon/HexagonCopyToCombine.cpp +++ lib/Target/Hexagon/HexagonCopyToCombine.cpp @@ -300,7 +300,7 @@ // * reads I2's def reg // * or has unmodelled side effects // we can't move I2 across it. - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (isUnsafeToMoveAcross(*I, I2UseReg, I2DestReg, TRI)) { @@ -358,7 +358,7 @@ // to remove the implicit killed %d4 operand. For now, we are // conservative and disallow the move. // we can't move I1 across it. - if (MI.isDebugValue()) { + if (MI.isDebugInstr()) { if (MI.readsRegister(I1DestReg, TRI)) // Move this instruction after I2. DbgMItoMove.push_back(&MI); continue; @@ -396,7 +396,7 @@ HexagonCopyToCombine::findPotentialNewifiableTFRs(MachineBasicBlock &BB) { DenseMap LastDef; for (MachineInstr &MI : BB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; // Mark TFRs that feed a potential new value store as such. @@ -423,7 +423,7 @@ MachineBasicBlock::iterator It(DefInst); unsigned NumInstsToDef = 0; while (&*It != &MI) { - if (!It->isDebugValue()) + if (!It->isDebugInstr()) ++NumInstsToDef; ++It; } @@ -489,7 +489,7 @@ MI != End;) { MachineInstr &I1 = *MI++; - if (I1.isDebugValue()) + if (I1.isDebugInstr()) continue; // Don't combine a TFR whose user could be newified (instructions that @@ -526,7 +526,7 @@ bool &DoInsertAtI1, bool AllowC64) { MachineBasicBlock::iterator I2 = std::next(MachineBasicBlock::iterator(I1)); - while (I2 != I1.getParent()->end() && I2->isDebugValue()) + while (I2 != I1.getParent()->end() && I2->isDebugInstr()) ++I2; unsigned I1DestReg = I1.getOperand(0).getReg(); Index: lib/Target/Hexagon/HexagonEarlyIfConv.cpp =================================================================== --- lib/Target/Hexagon/HexagonEarlyIfConv.cpp +++ lib/Target/Hexagon/HexagonEarlyIfConv.cpp @@ -368,7 +368,7 @@ return false; for (auto &MI : *B) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; if (MI.isConditionalBranch()) return false; Index: lib/Target/Hexagon/HexagonGenMux.cpp =================================================================== --- lib/Target/Hexagon/HexagonGenMux.cpp +++ lib/Target/Hexagon/HexagonGenMux.cpp @@ -356,7 +356,7 @@ return false; }; for (auto I = B.rbegin(), E = B.rend(); I != E; ++I) { - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; // This isn't 100% accurate, but it's safe. // It won't detect (as a kill) a case like this Index: lib/Target/Hexagon/HexagonInstrInfo.cpp =================================================================== --- lib/Target/Hexagon/HexagonInstrInfo.cpp +++ lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -134,7 +134,7 @@ MachineBasicBlock::const_instr_iterator MIE) { unsigned Count = 0; for (; MIB != MIE; ++MIB) { - if (!MIB->isDebugValue()) + if (!MIB->isDebugInstr()) ++Count; } return Count; @@ -419,7 +419,7 @@ I = MBB.instr_end(); --I; - while (I->isDebugValue()) { + while (I->isDebugInstr()) { if (I == MBB.instr_begin()) return false; --I; @@ -562,7 +562,7 @@ unsigned Count = 0; while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; // Only removing branches from end of MBB. if (!I->isBranch()) @@ -1568,7 +1568,7 @@ // considered a scheduling hazard, which is wrong. It should be the actual // instruction preceding the dbg_value instruction(s), just like it is // when debug info is not present. - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return false; // Throwing call is a boundary. @@ -3106,7 +3106,7 @@ I = MBB.instr_end(); --I; - while (I->isDebugValue()) { + while (I->isDebugInstr()) { if (I == MBB.instr_begin()) return Jumpers; --I; @@ -4143,7 +4143,7 @@ // use a constant extender, which requires another 4 bytes. // For debug instructions and prolog labels, return 0. unsigned HexagonInstrInfo::getSize(const MachineInstr &MI) const { - if (MI.isDebugValue() || MI.isPosition()) + if (MI.isDebugInstr() || MI.isPosition()) return 0; unsigned Size = MI.getDesc().getSize(); Index: lib/Target/Hexagon/HexagonNewValueJump.cpp =================================================================== --- lib/Target/Hexagon/HexagonNewValueJump.cpp +++ lib/Target/Hexagon/HexagonNewValueJump.cpp @@ -302,7 +302,7 @@ // and satisfy the following conditions. ++II; for (MachineBasicBlock::iterator localII = II; localII != end; ++localII) { - if (localII->isDebugValue()) + if (localII->isDebugInstr()) continue; // Check 1. @@ -494,7 +494,7 @@ for (MachineBasicBlock::iterator MII = MBB->end(), E = MBB->begin(); MII != E;) { MachineInstr &MI = *--MII; - if (MI.isDebugValue()) { + if (MI.isDebugInstr()) { continue; } Index: lib/Target/Hexagon/HexagonSplitDouble.cpp =================================================================== --- lib/Target/Hexagon/HexagonSplitDouble.cpp +++ lib/Target/Hexagon/HexagonSplitDouble.cpp @@ -164,7 +164,7 @@ if (MI->mayLoad() || MI->mayStore()) if (MemRefsFixed || isVolatileInstr(MI)) return true; - if (MI->isDebugValue()) + if (MI->isDebugInstr()) return false; unsigned Opc = MI->getOpcode(); Index: lib/Target/Hexagon/HexagonVLIWPacketizer.cpp =================================================================== --- lib/Target/Hexagon/HexagonVLIWPacketizer.cpp +++ lib/Target/Hexagon/HexagonVLIWPacketizer.cpp @@ -1034,7 +1034,7 @@ // Ignore bundling of pseudo instructions. bool HexagonPacketizerList::ignorePseudoInstruction(const MachineInstr &MI, const MachineBasicBlock *) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return true; if (MI.isCFIInstruction()) Index: lib/Target/Hexagon/RDFGraph.cpp =================================================================== --- lib/Target/Hexagon/RDFGraph.cpp +++ lib/Target/Hexagon/RDFGraph.cpp @@ -893,7 +893,7 @@ NodeAddr BA = newBlock(Func, &B); BlockNodes.insert(std::make_pair(&B, BA)); for (MachineInstr &I : B) { - if (I.isDebugValue()) + if (I.isDebugInstr()) continue; buildStmt(BA, I); } Index: lib/Target/Hexagon/RDFLiveness.cpp =================================================================== --- lib/Target/Hexagon/RDFLiveness.cpp +++ lib/Target/Hexagon/RDFLiveness.cpp @@ -880,7 +880,7 @@ for (auto I = B->rbegin(), E = B->rend(); I != E; ++I) { MachineInstr *MI = &*I; - if (MI->isDebugValue()) + if (MI->isDebugInstr()) continue; MI->clearKillInfo(); Index: lib/Target/Lanai/LanaiDelaySlotFiller.cpp =================================================================== --- lib/Target/Lanai/LanaiDelaySlotFiller.cpp +++ lib/Target/Lanai/LanaiDelaySlotFiller.cpp @@ -156,7 +156,7 @@ for (MachineBasicBlock::reverse_instr_iterator I = ++Slot.getReverse(); I != MBB.instr_rend(); ++I) { // skip debug value - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; // Convert to forward iterator. Index: lib/Target/Lanai/LanaiInstrInfo.cpp =================================================================== --- lib/Target/Lanai/LanaiInstrInfo.cpp +++ lib/Target/Lanai/LanaiInstrInfo.cpp @@ -573,8 +573,8 @@ while (Instruction != MBB.begin()) { --Instruction; - // Skip over debug values. - if (Instruction->isDebugValue()) + // Skip over debug instructions. + if (Instruction->isDebugInstr()) continue; // Working from the bottom, when we see a non-terminator @@ -699,7 +699,7 @@ while (Instruction != MBB.begin()) { --Instruction; - if (Instruction->isDebugValue()) + if (Instruction->isDebugInstr()) continue; if (Instruction->getOpcode() != Lanai::BT && Instruction->getOpcode() != Lanai::BRCC) { Index: lib/Target/Lanai/LanaiMemAluCombiner.cpp =================================================================== --- lib/Target/Lanai/LanaiMemAluCombiner.cpp +++ lib/Target/Lanai/LanaiMemAluCombiner.cpp @@ -343,7 +343,7 @@ break; // Skip over debug instructions - if (First->isDebugValue()) + if (First->isDebugInstr()) continue; if (isSuitableAluInstr(IsSpls, First, *Base, *Offset)) { Index: lib/Target/MSP430/MSP430InstrInfo.cpp =================================================================== --- lib/Target/MSP430/MSP430InstrInfo.cpp +++ lib/Target/MSP430/MSP430InstrInfo.cpp @@ -113,7 +113,7 @@ while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (I->getOpcode() != MSP430::JMP && I->getOpcode() != MSP430::JCC && @@ -183,7 +183,7 @@ MachineBasicBlock::iterator I = MBB.end(); while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; // Working from the bottom, when we see a non-terminator Index: lib/Target/Mips/MipsAsmPrinter.cpp =================================================================== --- lib/Target/Mips/MipsAsmPrinter.cpp +++ lib/Target/Mips/MipsAsmPrinter.cpp @@ -160,6 +160,8 @@ PrintDebugValueComment(MI, OS); return; } + if (MI->isDebugLabel()) + return; // If we just ended a constant pool, mark it as such. if (InConstantPool && Opc != Mips::CONSTPOOL_ENTRY) { Index: lib/Target/Mips/MipsConstantIslandPass.cpp =================================================================== --- lib/Target/Mips/MipsConstantIslandPass.cpp +++ lib/Target/Mips/MipsConstantIslandPass.cpp @@ -660,7 +660,7 @@ if (!BBHasFallthrough(&MBB)) WaterList.push_back(&MBB); for (MachineInstr &MI : MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; int Opc = MI.getOpcode(); Index: lib/Target/Mips/MipsDelaySlotFiller.cpp =================================================================== --- lib/Target/Mips/MipsDelaySlotFiller.cpp +++ lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -678,7 +678,7 @@ ++I; // skip debug value - if (CurrI->isDebugValue()) + if (CurrI->isDebugInstr()) continue; if (terminateSearch(*CurrI)) Index: lib/Target/Mips/MipsInstrInfo.cpp =================================================================== --- lib/Target/Mips/MipsInstrInfo.cpp +++ lib/Target/Mips/MipsInstrInfo.cpp @@ -163,7 +163,7 @@ // Note that indirect branches are not removed. while (I != REnd && removed < 2) { // Skip past debug instructions. - if (I->isDebugValue()) { + if (I->isDebugInstr()) { ++I; continue; } @@ -195,7 +195,7 @@ MachineBasicBlock::reverse_iterator I = MBB.rbegin(), REnd = MBB.rend(); // Skip all the debug instructions. - while (I != REnd && I->isDebugValue()) + while (I != REnd && I->isDebugInstr()) ++I; if (I == REnd || !isUnpredicatedTerminator(*I)) { @@ -220,7 +220,7 @@ // Skip past any debug instruction to see if the second last actual // is a branch. ++I; - while (I != REnd && I->isDebugValue()) + while (I != REnd && I->isDebugInstr()) ++I; if (I != REnd) { Index: lib/Target/Mips/MipsLongBranch.cpp =================================================================== --- lib/Target/Mips/MipsLongBranch.cpp +++ lib/Target/Mips/MipsLongBranch.cpp @@ -125,7 +125,7 @@ // found or it reaches E. static ReverseIter getNonDebugInstr(ReverseIter B, const ReverseIter &E) { for (; B != E; ++B) - if (!B->isDebugValue()) + if (!B->isDebugInstr()) return B; return E; Index: lib/Target/PowerPC/PPCEarlyReturn.cpp =================================================================== --- lib/Target/PowerPC/PPCEarlyReturn.cpp +++ lib/Target/PowerPC/PPCEarlyReturn.cpp @@ -128,7 +128,7 @@ if (J->getOperand(i).isMBB() && J->getOperand(i).getMBB() == &ReturnMBB) OtherReference = true; - } else if (!J->isTerminator() && !J->isDebugValue()) + } else if (!J->isTerminator() && !J->isDebugInstr()) break; if (J == (*PI)->begin()) Index: lib/Target/PowerPC/PPCHazardRecognizers.cpp =================================================================== --- lib/Target/PowerPC/PPCHazardRecognizers.cpp +++ lib/Target/PowerPC/PPCHazardRecognizers.cpp @@ -330,7 +330,7 @@ MachineInstr *MI = SU->getInstr(); - if (MI->isDebugValue()) + if (MI->isDebugInstr()) return NoHazard; unsigned Opcode = MI->getOpcode(); @@ -388,7 +388,7 @@ void PPCHazardRecognizer970::EmitInstruction(SUnit *SU) { MachineInstr *MI = SU->getInstr(); - if (MI->isDebugValue()) + if (MI->isDebugInstr()) return; unsigned Opcode = MI->getOpcode(); Index: lib/Target/PowerPC/PPCMIPeephole.cpp =================================================================== --- lib/Target/PowerPC/PPCMIPeephole.cpp +++ lib/Target/PowerPC/PPCMIPeephole.cpp @@ -232,7 +232,7 @@ SomethingChanged = false; for (MachineBasicBlock &MBB : *MF) { for (MachineInstr &MI : MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; if (TII->convertToImmediateForm(MI)) { @@ -261,7 +261,7 @@ } // Ignore debug instructions. - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; // Per-opcode peepholes. Index: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp =================================================================== --- lib/Target/PowerPC/PPCVSXSwapRemoval.cpp +++ lib/Target/PowerPC/PPCVSXSwapRemoval.cpp @@ -248,7 +248,7 @@ for (MachineBasicBlock &MBB : *MF) { for (MachineInstr &MI : MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; bool RelevantInstr = false; Index: lib/Target/Sparc/DelaySlotFiller.cpp =================================================================== --- lib/Target/Sparc/DelaySlotFiller.cpp +++ lib/Target/Sparc/DelaySlotFiller.cpp @@ -207,8 +207,8 @@ if (!done) --I; - // skip debug value - if (I->isDebugValue()) + // skip debug instruction + if (I->isDebugInstr()) continue; if (I->hasUnmodeledSideEffects() || I->isInlineAsm() || I->isPosition() || Index: lib/Target/Sparc/SparcInstrInfo.cpp =================================================================== --- lib/Target/Sparc/SparcInstrInfo.cpp +++ lib/Target/Sparc/SparcInstrInfo.cpp @@ -280,7 +280,7 @@ while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (I->getOpcode() != SP::BA Index: lib/Target/SystemZ/SystemZInstrInfo.cpp =================================================================== --- lib/Target/SystemZ/SystemZInstrInfo.cpp +++ lib/Target/SystemZ/SystemZInstrInfo.cpp @@ -389,7 +389,7 @@ MachineBasicBlock::iterator I = MBB.end(); while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; // Working from the bottom, when we see a non-terminator instruction, we're @@ -479,7 +479,7 @@ while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (!I->isBranch()) break; Index: lib/Target/SystemZ/SystemZLongBranch.cpp =================================================================== --- lib/Target/SystemZ/SystemZLongBranch.cpp +++ lib/Target/SystemZ/SystemZLongBranch.cpp @@ -295,7 +295,7 @@ // Add the terminators. while (MI != End) { - if (!MI->isDebugValue()) { + if (!MI->isDebugInstr()) { assert(MI->isTerminator() && "Terminator followed by non-terminator"); Terminators.push_back(describeTerminator(*MI)); skipTerminator(Position, Terminators.back(), false); Index: lib/Target/SystemZ/SystemZMachineScheduler.cpp =================================================================== --- lib/Target/SystemZ/SystemZMachineScheduler.cpp +++ lib/Target/SystemZ/SystemZMachineScheduler.cpp @@ -65,7 +65,7 @@ std::next(LastEmittedMI) : MBB->begin()); for (; I != NextBegin; ++I) { - if (I->isPosition() || I->isDebugValue()) + if (I->isPosition() || I->isDebugInstr()) continue; HazardRec->emitInstruction(&*I); } Index: lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp =================================================================== --- lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp +++ lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp @@ -257,7 +257,7 @@ for (MachineBasicBlock &MBB : reverse(MF)) { for (MachineInstr &MI : reverse(MBB)) { - if (MI.isPosition() || MI.isDebugValue()) + if (MI.isPosition() || MI.isDebugInstr()) continue; if (MI.getOpcode() == WebAssembly::END_BLOCK) { BlockTops[&MI]->getOperand(0).setImm(int32_t(retType)); Index: lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp =================================================================== --- lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp +++ lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp @@ -228,7 +228,7 @@ MachineInstr &MI = *I++; assert(!WebAssembly::isArgument(MI)); - if (MI.isDebugValue() || MI.isLabel()) + if (MI.isDebugInstr() || MI.isLabel()) continue; // Replace tee instructions with tee_local. The difference is that tee @@ -372,7 +372,7 @@ // Assert that all registers have been stackified at this point. for (const MachineBasicBlock &MBB : MF) { for (const MachineInstr &MI : MBB) { - if (MI.isDebugValue() || MI.isLabel()) + if (MI.isDebugInstr() || MI.isLabel()) continue; for (const MachineOperand &MO : MI.explicit_operands()) { assert( Index: lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp +++ lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp @@ -151,7 +151,7 @@ while (I != MBB.instr_begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (!I->isTerminator()) break; Index: lib/Target/WebAssembly/WebAssemblyRegStackify.cpp =================================================================== --- lib/Target/WebAssembly/WebAssemblyRegStackify.cpp +++ lib/Target/WebAssembly/WebAssemblyRegStackify.cpp @@ -159,7 +159,7 @@ assert(!MI.isPosition()); assert(!MI.isTerminator()); - if (MI.isDebugValue()) + if (MI.isDebugInstr()) return; // Check for loads. @@ -867,7 +867,7 @@ SmallVector Stack; for (MachineBasicBlock &MBB : MF) { for (MachineInstr &MI : MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; for (MachineOperand &MO : reverse(MI.explicit_operands())) { if (!MO.isReg()) Index: lib/Target/X86/X86CallFrameOptimization.cpp =================================================================== --- lib/Target/X86/X86CallFrameOptimization.cpp +++ lib/Target/X86/X86CallFrameOptimization.cpp @@ -375,7 +375,7 @@ // Skip over DEBUG_VALUE. // For globals in PIC mode, we can have some LEAs here. Skip them as well. // TODO: Extend this to something that covers more cases. - while (I->getOpcode() == X86::LEA32r || I->isDebugValue()) + while (I->getOpcode() == X86::LEA32r || I->isDebugInstr()) ++I; unsigned StackPtr = RegInfo.getStackRegister(); Index: lib/Target/X86/X86CmovConversion.cpp =================================================================== --- lib/Target/X86/X86CmovConversion.cpp +++ lib/Target/X86/X86CmovConversion.cpp @@ -295,7 +295,7 @@ for (auto &I : *MBB) { // Skip debug instructions. - if (I.isDebugValue()) + if (I.isDebugInstr()) continue; X86::CondCode CC = X86::getCondFromCMovOpc(I.getOpcode()); // Check if we found a X86::CMOVrr instruction. @@ -435,7 +435,7 @@ RegDefMaps[PhyRegType].clear(); for (MachineInstr &MI : *MBB) { // Skip debug instructions. - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; unsigned MIDepth = 0; unsigned MIDepthOpt = 0; @@ -605,7 +605,7 @@ SmallVector DBGInstructions; for (auto I = First->getIterator(), E = Last->getIterator(); I != E; I++) { - if (I->isDebugValue()) + if (I->isDebugInstr()) DBGInstructions.push_back(&*I); } Index: lib/Target/X86/X86FloatingPoint.cpp =================================================================== --- lib/Target/X86/X86FloatingPoint.cpp +++ lib/Target/X86/X86FloatingPoint.cpp @@ -1673,7 +1673,7 @@ for (MachineBasicBlock::reverse_iterator I = MBB.rbegin(), E = MBB.rend(); I != E; ++I) { - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; std::bitset<8> Defs; Index: lib/Target/X86/X86FrameLowering.cpp =================================================================== --- lib/Target/X86/X86FrameLowering.cpp +++ lib/Target/X86/X86FrameLowering.cpp @@ -2978,7 +2978,7 @@ // Count the number of uses for each object. for (auto &MBB : MF) { for (auto &MI : MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; for (const MachineOperand &MO : MI.operands()) { // Check to see if it's a local stack symbol. Index: lib/Target/X86/X86ISelLowering.cpp =================================================================== --- lib/Target/X86/X86ISelLowering.cpp +++ lib/Target/X86/X86ISelLowering.cpp @@ -27795,7 +27795,7 @@ MCSymbol *Sym = nullptr; for (const auto &MI : MBB) { - if (MI.isDebugValue()) + if (MI.isDebugInstr()) continue; assert(MI.isEHLabel() && "expected EH_LABEL"); Index: lib/Target/X86/X86InstrInfo.cpp =================================================================== --- lib/Target/X86/X86InstrInfo.cpp +++ lib/Target/X86/X86InstrInfo.cpp @@ -4297,8 +4297,8 @@ // This instruction defines EFLAGS, no need to look any further. return true; ++Iter; - // Skip over DBG_VALUE. - while (Iter != E && Iter->isDebugValue()) + // Skip over debug instructions. + while (Iter != E && Iter->isDebugInstr()) ++Iter; } @@ -4320,8 +4320,8 @@ return !MBB.isLiveIn(X86::EFLAGS); --Iter; - // Skip over DBG_VALUE. - while (Iter != B && Iter->isDebugValue()) + // Skip over debug instructions. + while (Iter != B && Iter->isDebugInstr()) --Iter; bool SawKill = false; @@ -6211,7 +6211,7 @@ MachineBasicBlock::iterator I = MBB.end(); while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (!I->isBranch()) assert(0 && "Can't find the branch to replace!"); @@ -6279,7 +6279,7 @@ MachineBasicBlock::iterator UnCondBrIter = MBB.end(); while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; // Working from the bottom, when we see a non-terminator instruction, we're @@ -6516,7 +6516,7 @@ while (I != MBB.begin()) { --I; - if (I->isDebugValue()) + if (I->isDebugInstr()) continue; if (I->getOpcode() != X86::JMP_1 && getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) @@ -11214,7 +11214,7 @@ X86InstrInfo::getOutliningType(MachineBasicBlock::iterator &MIT, unsigned Flags) const { MachineInstr &MI = *MIT; // Don't allow debug values to impact outlining type. - if (MI.isDebugValue() || MI.isIndirectDebugValue()) + if (MI.isDebugInstr() || MI.isIndirectDebugValue()) return MachineOutlinerInstrType::Invisible; // At this point, KILL instructions don't really tell us much so we can go Index: lib/Target/X86/X86PadShortFunction.cpp =================================================================== --- lib/Target/X86/X86PadShortFunction.cpp +++ lib/Target/X86/X86PadShortFunction.cpp @@ -132,7 +132,7 @@ "Basic block should contain at least a RET but is empty"); MachineBasicBlock::iterator ReturnLoc = --MBB->end(); - while (ReturnLoc->isDebugValue()) + while (ReturnLoc->isDebugInstr()) --ReturnLoc; assert(ReturnLoc->isReturn() && !ReturnLoc->isCall() && "Basic block does not end with RET"); Index: lib/Target/XCore/XCoreFrameLowering.cpp =================================================================== --- lib/Target/XCore/XCoreFrameLowering.cpp +++ lib/Target/XCore/XCoreFrameLowering.cpp @@ -427,7 +427,7 @@ bool emitFrameMoves = XCoreRegisterInfo::needsFrameMoves(*MF); DebugLoc DL; - if (MI != MBB.end() && !MI->isDebugValue()) + if (MI != MBB.end() && !MI->isDebugInstr()) DL = MI->getDebugLoc(); for (std::vector::const_iterator it = CSI.begin(); Index: lib/Target/XCore/XCoreInstrInfo.cpp =================================================================== --- lib/Target/XCore/XCoreInstrInfo.cpp +++ lib/Target/XCore/XCoreInstrInfo.cpp @@ -364,7 +364,7 @@ const TargetRegisterInfo *TRI) const { DebugLoc DL; - if (I != MBB.end() && !I->isDebugValue()) + if (I != MBB.end() && !I->isDebugInstr()) DL = I->getDebugLoc(); MachineFunction *MF = MBB.getParent(); const MachineFrameInfo &MFI = MF->getFrameInfo(); @@ -386,7 +386,7 @@ const TargetRegisterInfo *TRI) const { DebugLoc DL; - if (I != MBB.end() && !I->isDebugValue()) + if (I != MBB.end() && !I->isDebugInstr()) DL = I->getDebugLoc(); MachineFunction *MF = MBB.getParent(); const MachineFrameInfo &MFI = MF->getFrameInfo(); @@ -429,7 +429,7 @@ MachineBasicBlock::iterator MI, unsigned Reg, uint64_t Value) const { DebugLoc dl; - if (MI != MBB.end() && !MI->isDebugValue()) + if (MI != MBB.end() && !MI->isDebugInstr()) dl = MI->getDebugLoc(); if (isImmMskBitp(Value)) { int N = Log2_32(Value) + 1;