Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bf756bc
Use liberal vn for tls indirects
EgorBo Aug 1, 2022
c33bd4b
Merge branch 'main' of github.com:dotnet/runtime into main
EgorBo Aug 3, 2022
e9164de
Merge branch 'main' of github.com:dotnet/runtime into main
EgorBo Aug 3, 2022
24fc8a6
Initial impl
EgorBo Aug 4, 2022
75db099
Enable JitDisasm in Release
EgorBo Aug 4, 2022
0dfb332
Merge branch 'main' of github.com:dotnet/runtime into jit-disasm-release
EgorBo Aug 4, 2022
98a2a9d
Fix compilation errors
EgorBo Aug 4, 2022
3952560
Run jit-format
EgorBo Aug 4, 2022
c2d397a
Don't allocate instrDescDebugInfo when JitDisasm is not set
EgorBo Aug 4, 2022
f760723
fix build
EgorBo Aug 5, 2022
99c9254
clean up
EgorBo Aug 5, 2022
7fe3596
fix build
EgorBo Aug 5, 2022
4d776af
Apply Jakob's patch
EgorBo Aug 6, 2022
e95daa8
Remove some #ifdef DEBUG for displaying frame refs
jakobbotsch Aug 6, 2022
7255863
Fix alignment insertion assuming only emitForceNewIG can create new IGs
jakobbotsch Aug 6, 2022
be97773
Account for debug info when allocating IG buffers
jakobbotsch Aug 6, 2022
8f66d90
C++ify accessors
jakobbotsch Aug 6, 2022
611b9d2
Run jit-format
jakobbotsch Aug 6, 2022
adb7772
Fix a missing m_debugInfoSize add
jakobbotsch Aug 6, 2022
5e020ca
Couple of small cleanups
jakobbotsch Aug 6, 2022
9fa3367
Delete instrDesc constructors
jakobbotsch Aug 6, 2022
c0cb6da
Run jit-format
jakobbotsch Aug 6, 2022
8768b0e
Ensure alignment in inlineInstrDesc
jakobbotsch Aug 6, 2022
29f7c62
Update emitCheckAlignFitInCurIG
jakobbotsch Aug 6, 2022
6a1c872
Revert "Fix alignment insertion assuming only emitForceNewIG can crea…
jakobbotsch Aug 6, 2022
f266806
Oops
jakobbotsch Aug 6, 2022
829b019
Minor assertion nit
jakobbotsch Aug 6, 2022
13190b8
Update codegencommon.cpp
EgorBo Aug 8, 2022
b075a03
Tiny optimization
jakobbotsch Aug 8, 2022
d6759c2
Switch a couple of checks to m_debugInfoSize > 0
jakobbotsch Aug 8, 2022
00e754b
Move assert back
jakobbotsch Aug 8, 2022
318f275
Update emitarm64.cpp
EgorBo Aug 8, 2022
963596d
Add emitFirstInstrDesc and emitAdvanceInstrDesc
jakobbotsch Aug 9, 2022
840f26e
Fix function header
jakobbotsch Aug 9, 2022
4057d73
Fix build, fix bad refactor
jakobbotsch Aug 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable JitDisasm in Release
  • Loading branch information
EgorBo committed Aug 4, 2022
commit 75db09933ca3e5c1c0dcc3f1f9be68741847fa66
2 changes: 0 additions & 2 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,13 @@ class CodeGen final : public CodeGenInterface
void* coldCodePtr;
void* consPtr;

#ifdef DEBUG
// Last instr we have displayed for dspInstrs
unsigned genCurDispOffset;

static const char* genInsName(instruction ins);
const char* genInsDisplayName(emitter::instrDesc* id);

static const char* genSizeStr(emitAttr size);
#endif // DEBUG

void genInitialize();

Expand Down
14 changes: 7 additions & 7 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,10 +2076,6 @@ unsigned char Compiler::compGetJitDefaultFill(Compiler* comp)
return defaultFill;
}

#endif // DEBUG

/*****************************************************************************/
#ifdef DEBUG
/*****************************************************************************/

VarName Compiler::compVarName(regNumber reg, bool isFloatReg)
Expand Down Expand Up @@ -2124,13 +2120,15 @@ VarName Compiler::compVarName(regNumber reg, bool isFloatReg)
return nullptr;
}

#endif // DEBUG

const char* Compiler::compRegVarName(regNumber reg, bool displayVar, bool isFloatReg)
{

#ifdef TARGET_ARM
isFloatReg = genIsValidFloatReg(reg);
#endif

#ifdef DEBUG
if (displayVar && (reg != REG_NA))
{
VarName varName = compVarName(reg, isFloatReg);
Expand All @@ -2148,6 +2146,7 @@ const char* Compiler::compRegVarName(regNumber reg, bool displayVar, bool isFloa
return nameVarReg[index];
}
}
#endif

/* no debug info required or no variable in that register
-> return standard name */
Expand Down Expand Up @@ -2194,6 +2193,7 @@ const char* Compiler::compRegNameForSize(regNumber reg, size_t size)
return sizeNames[reg][size - 1];
}

#ifdef DEBUG
const char* Compiler::compLocalVarName(unsigned varNum, unsigned offs)
{
unsigned i;
Expand All @@ -2214,9 +2214,8 @@ const char* Compiler::compLocalVarName(unsigned varNum, unsigned offs)

return nullptr;
}
#endif

/*****************************************************************************/
#endif // DEBUG
/*****************************************************************************/

void Compiler::compSetProcessor()
Expand Down Expand Up @@ -6763,6 +6762,7 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
}
#endif

compMethodID = 0;
#ifdef DEBUG
/* Give the function a unique number */

Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9298,7 +9298,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
static MethodSet* s_pJitMethodSet;
#endif // DEBUG

#ifdef DEBUG
// silence warning of cast to greater size. It is easier to silence than construct code the compiler is happy with, and
// it is safe in this case
#pragma warning(push)
Expand All @@ -9316,6 +9315,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
return (o == ZERO) ? ZERO : (opts.dspDiffable ? T(0xD1FFAB1E) : o);
}
#pragma warning(pop)
#ifdef DEBUG

static int dspTreeID(GenTree* tree)
{
Expand Down Expand Up @@ -9787,8 +9787,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#endif

public:
#ifdef DEBUG
LONG compMethodID;
#ifdef DEBUG
unsigned compGenTreeID;
unsigned compStatementID;
unsigned compBasicBlockID;
Expand Down Expand Up @@ -10000,12 +10000,12 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

const char* compLocalVarName(unsigned varNum, unsigned offs);
VarName compVarName(regNumber reg, bool isFloatReg = false);
const char* compRegVarName(regNumber reg, bool displayVar = false, bool isFloatReg = false);
const char* compRegNameForSize(regNumber reg, size_t size);
const char* compFPregVarName(unsigned fpReg, bool displayVar = false);
void compDspSrcLinesByNativeIP(UNATIVE_OFFSET curIP);
void compDspSrcLinesByLineNum(unsigned line, bool seek = false);
#endif // DEBUG
const char* compRegNameForSize(regNumber reg, size_t size);
const char* compRegVarName(regNumber reg, bool displayVar = false, bool isFloatReg = false);

//-------------------------------------------------------------------------

Expand Down
29 changes: 8 additions & 21 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ void emitLocation::Print(LONG compMethodID) const
* Return the name of an instruction format.
*/

#if defined(DEBUG) || EMITTER_STATS

const char* emitter::emitIfName(unsigned f)
{
static const char* const ifNames[] = {
Expand All @@ -124,8 +122,6 @@ const char* emitter::emitIfName(unsigned f)
return errBuff;
}

#endif

/*****************************************************************************/

#if EMITTER_STATS
Expand Down Expand Up @@ -1363,14 +1359,14 @@ void emitter::appendToCurIG(instrDesc* id)
* Display (optionally) an instruction offset.
*/

#ifdef DEBUG

void emitter::emitDispInsAddr(BYTE* code)
{
#ifdef DEBUG
if (emitComp->opts.disAddr)
{
printf(FMT_ADDR, DBG_ADDR(code));
}
#endif
}

void emitter::emitDispInsOffs(unsigned offs, bool doffs)
Expand All @@ -1385,8 +1381,6 @@ void emitter::emitDispInsOffs(unsigned offs, bool doffs)
}
}

#endif // DEBUG

#ifdef JIT32_GCENCODER

/*****************************************************************************
Expand Down Expand Up @@ -1512,7 +1506,6 @@ void* emitter::emitAllocAnyInstr(size_t sz, emitAttr opsz)

emitInsCount++;

#if defined(DEBUG)
/* In debug mode we clear/set some additional fields */

instrDescDebugInfo* info = (instrDescDebugInfo*)emitGetMem(sizeof(*info));
Expand All @@ -1528,7 +1521,6 @@ void* emitter::emitAllocAnyInstr(size_t sz, emitAttr opsz)

id->idDebugOnlyInfo(info);

#endif // defined(DEBUG)

/* Store the size and handle the two special values
that indicate GCref and ByRef */
Expand Down Expand Up @@ -2644,11 +2636,7 @@ void* emitter::emitAddInlineLabel()
//
void emitter::emitPrintLabel(insGroup* ig)
{
#ifdef DEBUG
printf("G_M%03u_IG%02u", emitComp->compMethodID, ig->igNum);
#else
printf("IG_%02u", ig->igNum);
#endif
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -7704,14 +7692,14 @@ void emitter::emitOutputDataSec(dataSecDsc* sec, BYTE* dst)
printf("\nEmitting data sections: %u total bytes\n", sec->dsdOffs);
}

unsigned secNum = 0;
#endif

if (emitComp->opts.disAsm)
{
emitDispDataSec(sec, dst);
}

unsigned secNum = 0;
#endif

assert(dst);
assert(sec->dsdOffs);
assert(sec->dsdList);
Expand Down Expand Up @@ -7820,8 +7808,6 @@ void emitter::emitOutputDataSec(dataSecDsc* sec, BYTE* dst)
}
}

#ifdef DEBUG

//------------------------------------------------------------------------
// emitDispDataSec: Dump a data section to stdout.
//
Expand All @@ -7842,10 +7828,12 @@ void emitter::emitDispDataSec(dataSecDsc* section, BYTE* dst)

for (dataSection* data = section->dsdList; data != nullptr; data = data->dsNext)
{
#ifdef DEBUG
if (emitComp->opts.disAddr)
{
printf("; @" FMT_ADDR "\n", DBG_ADDR(dst));
}
#endif

const char* labelFormat = "%-7s";
char label[64];
Expand Down Expand Up @@ -7947,7 +7935,7 @@ void emitter::emitDispDataSec(dataSecDsc* section, BYTE* dst)
{
case TYP_FLOAT:
assert(data->dsSize >= 4);
printf("\tdd\t%08llXh\t", *reinterpret_cast<uint32_t*>(&data->dsCont[i]));
printf("\tdd\t%08llXh\t", (UINT64)*reinterpret_cast<uint32_t*>(&data->dsCont[i]));
printf("\t; %9.6g", *reinterpret_cast<float*>(&data->dsCont[i]));
i += 4;
break;
Expand Down Expand Up @@ -8022,7 +8010,6 @@ void emitter::emitDispDataSec(dataSecDsc* section, BYTE* dst)
}
}
}
#endif

/*****************************************************************************/
/*****************************************************************************
Expand Down
29 changes: 3 additions & 26 deletions src/coreclr/jit/emit.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,6 @@ class emitter

#endif // TARGET_XARCH

#ifdef DEBUG // This information is used in DEBUG builds for additional diagnostics

struct instrDesc;

struct instrDescDebugInfo
Expand All @@ -570,8 +568,6 @@ class emitter
CORINFO_SIG_INFO* idCallSig; // Used to report native call site signatures to the EE
};

#endif // DEBUG

#ifdef TARGET_ARM
unsigned insEncodeSetFlags(insFlags sf);

Expand Down Expand Up @@ -810,8 +806,6 @@ class emitter
////////////////////////////////////////////////////////////////////////
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef DEBUG

instrDescDebugInfo* _idDebugOnlyInfo;

public:
Expand All @@ -825,7 +819,6 @@ class emitter
}

private:
#endif // DEBUG

CLANG_FORMAT_COMMENT_ANCHOR;

Expand All @@ -849,11 +842,7 @@ class emitter
emitter::emitAllocInstr() to clear them.
*/

#if DEBUG
#define SMALL_IDSC_DEBUG_EXTRA (sizeof(void*))
#else
#define SMALL_IDSC_DEBUG_EXTRA (0)
#endif

#define SMALL_IDSC_SIZE (8 + SMALL_IDSC_DEBUG_EXTRA)

Expand Down Expand Up @@ -1681,9 +1670,7 @@ class emitter
ssize_t emitGetInsCIdisp(instrDesc* id);
unsigned emitGetInsCIargs(instrDesc* id);

#ifdef DEBUG
inline static emitAttr emitGetMemOpSize(instrDesc* id);
#endif // DEBUG

// Return the argument count for a direct call "id".
int emitGetInsCDinfo(instrDesc* id);
Expand All @@ -1697,15 +1684,13 @@ class emitter
/* A few routines used for debug display purposes */
/************************************************************************/

#if defined(DEBUG) || EMITTER_STATS

static const char* emitIfName(unsigned f);

#endif // defined(DEBUG) || EMITTER_STATS

#ifdef DEBUG

unsigned emitVarRefOffs;
#else // !DEBUG
#define emitVarRefOffs 0
#endif // !DEBUG

const char* emitRegName(regNumber reg, emitAttr size = EA_PTRSIZE, bool varName = true);
const char* emitFloatRegName(regNumber reg, emitAttr size = EA_PTRSIZE, bool varName = true);
Expand Down Expand Up @@ -1747,10 +1732,6 @@ class emitter
size_t sz = 0,
insGroup* ig = nullptr);

#else // !DEBUG
#define emitVarRefOffs 0
#endif // !DEBUG

/************************************************************************/
/* Method prolog and epilog */
/************************************************************************/
Expand Down Expand Up @@ -2557,9 +2538,7 @@ class emitter
dataSection* emitDataSecCur;

void emitOutputDataSec(dataSecDsc* sec, BYTE* dst);
#ifdef DEBUG
void emitDispDataSec(dataSecDsc* section, BYTE* dst);
#endif

/************************************************************************/
/* Handles to the current class and method. */
Expand Down Expand Up @@ -3107,7 +3086,6 @@ inline unsigned emitter::emitGetInsCIargs(instrDesc* id)
}
}

#ifdef DEBUG
//-----------------------------------------------------------------------------
// emitGetMemOpSize: Get the memory operand size of instrDesc.
//
Expand Down Expand Up @@ -3275,7 +3253,6 @@ inline unsigned emitter::emitGetInsCIargs(instrDesc* id)
}
}
}
#endif // DEBUG

#endif // TARGET_XARCH

Expand Down
Loading