From 8039692234badb85214867610dd1ae5618ce2f8d Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Sun, 1 Mar 2020 01:37:17 -0800 Subject: [PATCH] Revert "Change debug info default variable tracking system" (#33021) --- src/coreclr/src/jit/codegenarmarch.cpp | 6 +++--- src/coreclr/src/jit/codegencommon.cpp | 16 +++------------- src/coreclr/src/jit/codegeninterface.h | 4 ++-- src/coreclr/src/jit/emit.cpp | 15 --------------- src/coreclr/src/jit/emit.h | 4 +--- src/coreclr/src/jit/emitpub.h | 2 +- 6 files changed, 10 insertions(+), 37 deletions(-) diff --git a/src/coreclr/src/jit/codegenarmarch.cpp b/src/coreclr/src/jit/codegenarmarch.cpp index 4350e1d..47678ff 100644 --- a/src/coreclr/src/jit/codegenarmarch.cpp +++ b/src/coreclr/src/jit/codegenarmarch.cpp @@ -2412,11 +2412,11 @@ void CodeGen::genRegCopy(GenTree* treeNode) #ifdef USING_VARIABLE_LIVE_RANGE // Report the home change for this variable - varLiveKeeper->siUpdateVariableLiveRange(varDsc, lcl->GetLclNum()); + varLiveKeeper->siUpdateVariableLiveRange(varDsc, lcl->GetLclNum()) #endif // USING_VARIABLE_LIVE_RANGE - // The new location is going live - genUpdateRegLife(varDsc, /*isBorn*/ true, /*isDying*/ false DEBUGARG(treeNode)); + // The new location is going live + genUpdateRegLife(varDsc, /*isBorn*/ true, /*isDying*/ false DEBUGARG(treeNode)); } } } diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index 2de0553..12fd7a5 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/src/jit/codegencommon.cpp @@ -11474,19 +11474,9 @@ void CodeGenInterface::VariableLiveKeeper::VariableLiveDescriptor::startLiveRang // Is the first "VariableLiveRange" or the previous one has been closed so its "m_EndEmitLocation" is valid noway_assert(m_VariableLiveRanges->empty() || m_VariableLiveRanges->back().m_EndEmitLocation.Valid()); - if (!m_VariableLiveRanges->empty() && m_VariableLiveRanges->back().m_EndEmitLocation.IsPreviousInsNum(emit) && - siVarLoc::Equals(&varLocation, &(m_VariableLiveRanges->back().m_VarLocation))) - { - // The variable is being born just after the instruction at which it died. - // In this case, i.e. an update of the variable's value, we coalesce the live ranges. - m_VariableLiveRanges->back().m_EndEmitLocation.Init(); - } - else - { - // Creates new live range with invalid end - m_VariableLiveRanges->emplace_back(varLocation, emitLocation(), emitLocation()); - m_VariableLiveRanges->back().m_StartEmitLocation.CaptureLocation(emit); - } + // Creates new live range with invalid end + m_VariableLiveRanges->emplace_back(varLocation, emitLocation(), emitLocation()); + m_VariableLiveRanges->back().m_StartEmitLocation.CaptureLocation(emit); #ifdef DEBUG if (!m_VariableLifeBarrier->hasLiveRangesToDump()) diff --git a/src/coreclr/src/jit/codegeninterface.h b/src/coreclr/src/jit/codegeninterface.h index 9d4f49f..2b48480 100644 --- a/src/coreclr/src/jit/codegeninterface.h +++ b/src/coreclr/src/jit/codegeninterface.h @@ -26,11 +26,11 @@ #include "treelifeupdater.h" #include "emit.h" -#if 0 +#if 1 // Enable USING_SCOPE_INFO flag to use psiScope/siScope info to report variables' locations. #define USING_SCOPE_INFO #endif -#if 1 +#if 0 // Enable USING_VARIABLE_LIVE_RANGE flag to use VariableLiveRange info to report variables' locations. // Note: if both USING_SCOPE_INFO and USING_VARIABLE_LIVE_RANGE are defined, then USING_SCOPE_INFO // information is reported to the debugger. diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index 3069502..779b1a4 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -65,21 +65,6 @@ UNATIVE_OFFSET emitLocation::GetFuncletPrologOffset(emitter* emit) const return emit->emitCurIGsize; } -//------------------------------------------------------------------------ -// IsPreviousInsNum: Returns true if the emitter is on the next instruction -// of the same group as this emitLocation. -// -// Arguments: -// emit - an emitter* instance -// -bool emitLocation::IsPreviousInsNum(const emitter* emit) const -{ - assert(Valid()); - bool isSameGroup = (ig == emit->emitCurIG); - bool isSameInsNum = (emitGetInsNumFromCodePos(codePos) == emitGetInsNumFromCodePos(emit->emitCurOffset()) - 1); - return isSameGroup && isSameInsNum; -} - #ifdef DEBUG void emitLocation::Print(LONG compMethodID) const { diff --git a/src/coreclr/src/jit/emit.h b/src/coreclr/src/jit/emit.h index 2a3e5a7..3045610 100644 --- a/src/coreclr/src/jit/emit.h +++ b/src/coreclr/src/jit/emit.h @@ -191,8 +191,6 @@ public: UNATIVE_OFFSET GetFuncletPrologOffset(emitter* emit) const; - bool emitLocation::IsPreviousInsNum(const emitter* emit) const; - #ifdef DEBUG void Print(LONG compMethodID) const; #endif // DEBUG @@ -2391,7 +2389,7 @@ inline unsigned emitGetInsOfsFromCodePos(unsigned codePos) return (codePos >> 16); } -inline unsigned emitter::emitCurOffset() const +inline unsigned emitter::emitCurOffset() { unsigned codePos = emitCurIGinsCnt + (emitCurIGsize << 16); diff --git a/src/coreclr/src/jit/emitpub.h b/src/coreclr/src/jit/emitpub.h index bc8abf3..cd28e03 100644 --- a/src/coreclr/src/jit/emitpub.h +++ b/src/coreclr/src/jit/emitpub.h @@ -65,7 +65,7 @@ void emitFinishPrologEpilogGeneration(); /************************************************************************/ void* emitCurBlock(); -unsigned emitCurOffset() const; +unsigned emitCurOffset(); UNATIVE_OFFSET emitCodeOffset(void* blockPtr, unsigned codeOffs); -- 2.7.4