[llvm] r363259 - [NFC] Sink a function call into LiveDebugValues::process
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 06:11:58 PDT 2019
Author: jmorse
Date: Thu Jun 13 06:11:57 2019
New Revision: 363259
URL: http://llvm.org/viewvc/llvm-project?rev=363259&view=rev
Log:
[NFC] Sink a function call into LiveDebugValues::process
This was requested in D62904, which I successfully missed. This is just
a refactor and shouldn't change any behaviour.
Modified:
llvm/trunk/lib/CodeGen/LiveDebugValues.cpp
Modified: llvm/trunk/lib/CodeGen/LiveDebugValues.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveDebugValues.cpp?rev=363259&r1=363258&r2=363259&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveDebugValues.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveDebugValues.cpp Thu Jun 13 06:11:57 2019
@@ -356,7 +356,8 @@ private:
bool process(MachineInstr &MI, OpenRangesSet &OpenRanges,
VarLocInMBB &OutLocs, VarLocMap &VarLocIDs,
- TransferMap &Transfers, bool transferChanges);
+ TransferMap &Transfers, bool transferChanges,
+ OverlapMap &OverlapFragments, VarToFragments &SeenFragments);
void accumulateFragmentMap(MachineInstr &MI, VarToFragments &SeenFragments,
OverlapMap &OLapMap);
@@ -940,13 +941,19 @@ void LiveDebugValues::accumulateFragment
/// This routine creates OpenRanges and OutLocs.
bool LiveDebugValues::process(MachineInstr &MI, OpenRangesSet &OpenRanges,
VarLocInMBB &OutLocs, VarLocMap &VarLocIDs,
- TransferMap &Transfers, bool transferChanges) {
+ TransferMap &Transfers, bool transferChanges,
+ OverlapMap &OverlapFragments,
+ VarToFragments &SeenFragments) {
bool Changed = false;
transferDebugValue(MI, OpenRanges, VarLocIDs);
transferRegisterDef(MI, OpenRanges, VarLocIDs);
if (transferChanges) {
transferRegisterCopy(MI, OpenRanges, VarLocIDs, Transfers);
transferSpillOrRestoreInst(MI, OpenRanges, VarLocIDs, Transfers);
+ } else {
+ // Build up a map of overlapping fragments on the first run through.
+ if (MI.isDebugValue())
+ accumulateFragmentMap(MI, SeenFragments, OverlapFragments);
}
Changed = transferTerminatorInst(MI, OpenRanges, OutLocs, VarLocIDs);
return Changed;
@@ -1101,9 +1108,7 @@ bool LiveDebugValues::ExtendRanges(Machi
for (auto &MBB : MF) {
for (auto &MI : MBB) {
process(MI, OpenRanges, OutLocs, VarLocIDs, Transfers,
- dontTransferChanges);
- if (MI.isDebugValue())
- accumulateFragmentMap(MI, SeenFragments, OverlapFragments);
+ dontTransferChanges, OverlapFragments, SeenFragments);
}
}
@@ -1151,8 +1156,9 @@ bool LiveDebugValues::ExtendRanges(Machi
// examine spill instructions to see whether they spill registers that
// correspond to user variables.
for (auto &MI : *MBB)
- OLChanged |= process(MI, OpenRanges, OutLocs, VarLocIDs, Transfers,
- transferChanges);
+ OLChanged |=
+ process(MI, OpenRanges, OutLocs, VarLocIDs, Transfers,
+ transferChanges, OverlapFragments, SeenFragments);
// Add any DBG_VALUE instructions necessitated by spills.
for (auto &TR : Transfers)
More information about the llvm-commits
mailing list