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
Fix compilation errors
  • Loading branch information
EgorBo committed Aug 4, 2022
commit 98a2a9dec054904f0884df40a479e0d36535146d
31 changes: 5 additions & 26 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3070,36 +3070,15 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
s_pJitFunctionFileInitialized = true;
}
#else // DEBUG
if (!jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT))
if (!JitConfig.JitDisasm().isEmpty())
{
if (!JitConfig.JitDisasm().isEmpty())
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, nullptr);
const char* className = info.compCompHnd->getClassName(info.compClassHnd);
if (JitConfig.JitDisasm().contains(methodName, className, &info.compMethodInfo->args))
{
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, nullptr);
const char* className = info.compCompHnd->getClassName(info.compClassHnd);

if (JitConfig.JitDisasm().contains(methodName, className, &info.compMethodInfo->args))
{
opts.disAsm = true;
}
}
}
else
{
if (!JitConfig.NgenDisasm().isEmpty())
{
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, nullptr);
const char* className = info.compCompHnd->getClassName(info.compClassHnd);

if (JitConfig.NgenDisasm().contains(methodName, className, &info.compMethodInfo->args))
{
opts.disAsm = true;
}
opts.disAsm = true;
}
}

bool diffable = JitConfig.DiffableDasm();
opts.disDiffable = diffable;
opts.dspDiffable = diffable;
#endif // !DEBUG

//-------------------------------------------------------------------------
Expand Down
20 changes: 18 additions & 2 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9296,7 +9296,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

static bool s_pJitFunctionFileInitialized;
static MethodSet* s_pJitMethodSet;
#endif // 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
Expand All @@ -9315,6 +9314,23 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
return (o == ZERO) ? ZERO : (opts.dspDiffable ? T(0xD1FFAB1E) : o);
}
#pragma warning(pop)
#else
#pragma warning(push)
#pragma warning(disable : 4312)
template <typename T>
T dspPtr(T p)
{
return p;
}

template <typename T>
T dspOffset(T o)
{
return o;
}
#pragma warning(pop)
#endif

#ifdef DEBUG

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

public:
LONG compMethodID;
#ifdef DEBUG
unsigned compGenTreeID;
unsigned compStatementID;
unsigned compBasicBlockID;
#endif
LONG compMethodID;

BasicBlock* compCurBB; // the current basic block in process
Statement* compCurStmt; // the current statement in process
Expand Down
24 changes: 15 additions & 9 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,6 @@ void* emitter::emitAllocAnyInstr(size_t sz, emitAttr opsz)

emitInsCount++;

/* In debug mode we clear/set some additional fields */

instrDescDebugInfo* info = (instrDescDebugInfo*)emitGetMem(sizeof(*info));

info->idNum = emitInsCount;
Expand Down Expand Up @@ -2654,11 +2652,7 @@ const char* emitter::emitLabelString(insGroup* ig)
static char buf[4][TEMP_BUFFER_LEN];
const char* retbuf;

#ifdef DEBUG
sprintf_s(buf[curBuf], TEMP_BUFFER_LEN, "G_M%03u_IG%02u", emitComp->compMethodID, ig->igNum);
#else
sprintf_s(buf[curBuf], TEMP_BUFFER_LEN, "IG_%02u", ig->igNum);
#endif
retbuf = buf[curBuf];
curBuf = (curBuf + 1) % 4;
return retbuf;
Expand Down Expand Up @@ -4060,7 +4054,6 @@ void emitter::emitRecomputeIGoffsets()
//
void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlags flag)
{
#ifdef DEBUG
#ifdef TARGET_XARCH
const char* commentPrefix = " ;";
#else
Expand Down Expand Up @@ -4099,6 +4092,7 @@ void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlag
const char* str = nullptr;
if (flag == GTF_ICON_STR_HDL)
{
#ifdef DEBUG
const WCHAR* wstr = emitComp->eeGetCPString(handle);
// NOTE: eGetCPString always returns nullptr on Linux/ARM
if (wstr == nullptr)
Expand Down Expand Up @@ -4131,6 +4125,9 @@ void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlag
}
printf("%s \"%S\"", commentPrefix, buf);
}
#else
str = "string handle";
#endif
}
else if (flag == GTF_ICON_CLASS_HDL)
{
Expand Down Expand Up @@ -4169,7 +4166,6 @@ void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlag
{
printf("%s %s", commentPrefix, str);
}
#endif // DEBUG
}

//****************************************************************************
Expand Down Expand Up @@ -6671,6 +6667,10 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
if (emitComp->opts.disAsm)
{
printf("\n%s:", emitLabelString(ig));
if (!emitComp->opts.disDiffable)
{
printf(" ;; offset=%04XH", emitCurCodeOffs(cp));
}
printf("\n");
}
#endif // !DEBUG
Expand Down Expand Up @@ -6914,7 +6914,13 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
ig->igPerfScore);
}
*instrCount += ig->igInsCnt;
#endif // DEBUG
#else // DEBUG
if (emitComp->opts.disAsm)
{
// Separate IGs with a blank line
printf(" ");
}
#endif // !DEBUG

emitCurIG = nullptr;

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9125,11 +9125,11 @@ void emitter::emitDispIns(
}
else if ((val > 0) || (val < -0xFFFFFF))
{
printf("0x%IX", (INT64)val);
printf("0x%IX", (ssize_t)val);
}
else
{ // (val < 0)
printf("-0x%IX", (INT64)-val);
printf("-0x%IX", (ssize_t)-val);
}
emitDispCommentForHandle(srcVal, id->idDebugOnlyInfo()->idMemCookie, id->idDebugOnlyInfo()->idFlags);
}
Expand Down
20 changes: 19 additions & 1 deletion src/coreclr/jit/jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,6 @@ inline bool IsUninitialized(T data)
{
return data == UninitializedWord<T>(JitTls::GetCompiler());
}
#else // !defined(DEBUG)

#pragma warning(push)
#pragma warning(disable : 4312)
Expand All @@ -820,6 +819,25 @@ T dspOffset(T o)
}
#pragma warning(pop)

#else // !defined(DEBUG)

//****************************************************************************
//
// Non-Debug template definitions for dspPtr, dspOffset
// - This is a nop in non-Debug builds
//
template <typename T>
T dspPtr(T p)
{
return p;
}

template <typename T>
T dspOffset(T o)
{
return o;
}

#endif // !defined(DEBUG)

struct LikelyClassMethodRecord
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/jitconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ CONFIG_METHODSET(JitUnwindDump, W("JitUnwindDump")) // Dump the unwind codes for
///
/// NGEN
///
CONFIG_METHODSET(NgenDisasm, W("NgenDisasm")) // Same as JitDisasm, but for ngen
CONFIG_METHODSET(NgenDump, W("NgenDump")) // Same as JitDump, but for ngen
CONFIG_METHODSET(NgenEHDump, W("NgenEHDump")) // Dump the EH table for the method, as reported to the VM
CONFIG_METHODSET(NgenGCDump, W("NgenGCDump"))
Expand Down
20 changes: 0 additions & 20 deletions src/coreclr/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10421,26 +10421,6 @@ void Compiler::fgValueNumberAddExceptionSetForIndirection(GenTree* tree, GenTree
vnStore->VNExcSetSingleton(vnStore->VNForFunc(TYP_REF, VNF_NullPtrExc, vnpBaseNorm.GetConservative())));
}

VNFuncApp func;
if (vnStore->GetVNFunc(vnpBaseNorm.GetConservative(), &func) &&
(func.m_func == VNF_GetsharedGcthreadstaticBaseNoctor))
{
switch (func.m_func)
{
case VNF_GetgenericsGcthreadstaticBase:
case VNF_GetgenericsNongcthreadstaticBase:
case VNF_GetsharedGcthreadstaticBase:
case VNF_GetsharedNongcthreadstaticBase:
case VNF_GetsharedGcthreadstaticBaseNoctor:
case VNF_GetsharedNongcthreadstaticBaseNoctor:
case VNF_GetsharedGcthreadstaticBaseDynamicclass:
case VNF_GetsharedNongcthreadstaticBaseDynamicclass:
tree->gtVNPair.SetConservative(tree->gtVNPair.GetLiberal());
break;
default:
break;
}
}
// Add the NullPtrExc to "tree"'s value numbers.
tree->gtVNPair = vnStore->VNPWithExc(tree->gtVNPair, excChkSet);
}
Expand Down