Skip to content

Commit 8039692

Browse files
authored
Revert "Change debug info default variable tracking system" (#33021)
1 parent 6d9e503 commit 8039692

File tree

6 files changed

+10
-37
lines changed

6 files changed

+10
-37
lines changed

src/coreclr/src/jit/codegenarmarch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,11 +2412,11 @@ void CodeGen::genRegCopy(GenTree* treeNode)
24122412

24132413
#ifdef USING_VARIABLE_LIVE_RANGE
24142414
// Report the home change for this variable
2415-
varLiveKeeper->siUpdateVariableLiveRange(varDsc, lcl->GetLclNum());
2415+
varLiveKeeper->siUpdateVariableLiveRange(varDsc, lcl->GetLclNum())
24162416
#endif // USING_VARIABLE_LIVE_RANGE
24172417

2418-
// The new location is going live
2419-
genUpdateRegLife(varDsc, /*isBorn*/ true, /*isDying*/ false DEBUGARG(treeNode));
2418+
// The new location is going live
2419+
genUpdateRegLife(varDsc, /*isBorn*/ true, /*isDying*/ false DEBUGARG(treeNode));
24202420
}
24212421
}
24222422
}

src/coreclr/src/jit/codegencommon.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11474,19 +11474,9 @@ void CodeGenInterface::VariableLiveKeeper::VariableLiveDescriptor::startLiveRang
1147411474
// Is the first "VariableLiveRange" or the previous one has been closed so its "m_EndEmitLocation" is valid
1147511475
noway_assert(m_VariableLiveRanges->empty() || m_VariableLiveRanges->back().m_EndEmitLocation.Valid());
1147611476

11477-
if (!m_VariableLiveRanges->empty() && m_VariableLiveRanges->back().m_EndEmitLocation.IsPreviousInsNum(emit) &&
11478-
siVarLoc::Equals(&varLocation, &(m_VariableLiveRanges->back().m_VarLocation)))
11479-
{
11480-
// The variable is being born just after the instruction at which it died.
11481-
// In this case, i.e. an update of the variable's value, we coalesce the live ranges.
11482-
m_VariableLiveRanges->back().m_EndEmitLocation.Init();
11483-
}
11484-
else
11485-
{
11486-
// Creates new live range with invalid end
11487-
m_VariableLiveRanges->emplace_back(varLocation, emitLocation(), emitLocation());
11488-
m_VariableLiveRanges->back().m_StartEmitLocation.CaptureLocation(emit);
11489-
}
11477+
// Creates new live range with invalid end
11478+
m_VariableLiveRanges->emplace_back(varLocation, emitLocation(), emitLocation());
11479+
m_VariableLiveRanges->back().m_StartEmitLocation.CaptureLocation(emit);
1149011480

1149111481
#ifdef DEBUG
1149211482
if (!m_VariableLifeBarrier->hasLiveRangesToDump())

src/coreclr/src/jit/codegeninterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
#include "treelifeupdater.h"
2727
#include "emit.h"
2828

29-
#if 0
29+
#if 1
3030
// Enable USING_SCOPE_INFO flag to use psiScope/siScope info to report variables' locations.
3131
#define USING_SCOPE_INFO
3232
#endif
33-
#if 1
33+
#if 0
3434
// Enable USING_VARIABLE_LIVE_RANGE flag to use VariableLiveRange info to report variables' locations.
3535
// Note: if both USING_SCOPE_INFO and USING_VARIABLE_LIVE_RANGE are defined, then USING_SCOPE_INFO
3636
// information is reported to the debugger.

src/coreclr/src/jit/emit.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,6 @@ UNATIVE_OFFSET emitLocation::GetFuncletPrologOffset(emitter* emit) const
6565
return emit->emitCurIGsize;
6666
}
6767

68-
//------------------------------------------------------------------------
69-
// IsPreviousInsNum: Returns true if the emitter is on the next instruction
70-
// of the same group as this emitLocation.
71-
//
72-
// Arguments:
73-
// emit - an emitter* instance
74-
//
75-
bool emitLocation::IsPreviousInsNum(const emitter* emit) const
76-
{
77-
assert(Valid());
78-
bool isSameGroup = (ig == emit->emitCurIG);
79-
bool isSameInsNum = (emitGetInsNumFromCodePos(codePos) == emitGetInsNumFromCodePos(emit->emitCurOffset()) - 1);
80-
return isSameGroup && isSameInsNum;
81-
}
82-
8368
#ifdef DEBUG
8469
void emitLocation::Print(LONG compMethodID) const
8570
{

src/coreclr/src/jit/emit.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ class emitLocation
191191

192192
UNATIVE_OFFSET GetFuncletPrologOffset(emitter* emit) const;
193193

194-
bool emitLocation::IsPreviousInsNum(const emitter* emit) const;
195-
196194
#ifdef DEBUG
197195
void Print(LONG compMethodID) const;
198196
#endif // DEBUG
@@ -2391,7 +2389,7 @@ inline unsigned emitGetInsOfsFromCodePos(unsigned codePos)
23912389
return (codePos >> 16);
23922390
}
23932391

2394-
inline unsigned emitter::emitCurOffset() const
2392+
inline unsigned emitter::emitCurOffset()
23952393
{
23962394
unsigned codePos = emitCurIGinsCnt + (emitCurIGsize << 16);
23972395

src/coreclr/src/jit/emitpub.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void emitFinishPrologEpilogGeneration();
6565
/************************************************************************/
6666

6767
void* emitCurBlock();
68-
unsigned emitCurOffset() const;
68+
unsigned emitCurOffset();
6969

7070
UNATIVE_OFFSET emitCodeOffset(void* blockPtr, unsigned codeOffs);
7171

0 commit comments

Comments
 (0)