Skip to content

Commit 9885fbe

Browse files
Improve LSRA and other dump output (dotnet#71499)
E.g., Update LSRA "Allocating Registers" table description. Dump nodes added during resolution, e.g.: ``` BB29 bottom (BB08->BB08): move V25 from STK to rdi (Critical) N001 ( 1, 1) [001174] ----------z t1174 = LCL_VAR int V25 cse4 rdi REG rdi ``` Dump more data in the LSRA block sequence data: ``` -BB03( 16 ) -BB04( 4 ) +BB03 ( 16 ) critical-in critical-out +BB04 ( 4 ) critical-out ``` When dumping various flow bitvectors, annotate the bitvectors better: ``` -BB25 in gen out -0000000000000000 -0000000000000003 CSE #1.c -0000000000000003 CSE #1.c +BB25 + in: 0000000000000000 +gen: 0000000000000003 CSE #1.c +out: 0000000000000003 CSE #1.c ``` Dump hoisting bitvectors using the sorting number: ``` - USEDEF (5)={V04 V00 V01 V02 V03} + USEDEF (5)={V00 V01 V02 V03 V04} ``` Also, fix various typos and formatting.
1 parent 436ee2e commit 9885fbe

File tree

12 files changed

+173
-128
lines changed

12 files changed

+173
-128
lines changed

src/coreclr/jit/compiler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4706,6 +4706,7 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
47064706
// Figure out what locals are address-taken.
47074707
//
47084708
DoPhase(this, PHASE_STR_ADRLCL, &Compiler::fgMarkAddressExposedLocals);
4709+
47094710
// Run a simple forward substitution pass.
47104711
//
47114712
DoPhase(this, PHASE_FWD_SUB, &Compiler::fgForwardSub);

src/coreclr/jit/flowgraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ GenTree* Compiler::fgCreateMonitorTree(unsigned lvaMonAcquired, unsigned lvaThis
18941894
{
18951895
// have to insert this immediately before the GT_RETURN so we transform:
18961896
// ret(...) ->
1897-
// ret(comma(comma(tmp=...,call mon_exit), tmp)
1897+
// ret(comma(comma(tmp=...,call mon_exit), tmp))
18981898
//
18991899
//
19001900
// Before morph stage, it is possible to have a case of GT_RETURN(TYP_LONG, op1) where op1's type is

src/coreclr/jit/gentree.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ struct GenTree
12331233
return (gtOper == GT_LCL_FLD || gtOper == GT_LCL_FLD_ADDR || gtOper == GT_STORE_LCL_FLD);
12341234
}
12351235

1236-
inline bool OperIsLocalField() const
1236+
bool OperIsLocalField() const
12371237
{
12381238
return OperIsLocalField(gtOper);
12391239
}
@@ -8673,13 +8673,13 @@ inline GenTree* GenTree::gtEffectiveVal(bool commaOnly /* = false */)
86738673
}
86748674

86758675
//-------------------------------------------------------------------------
8676-
// gtCommaAssignVal - find value being assigned to a comma wrapped assigment
8676+
// gtCommaAssignVal - find value being assigned to a comma wrapped assignment
86778677
//
86788678
// Returns:
86798679
// tree representing value being assigned if this tree represents a
86808680
// comma-wrapped local definition and use.
86818681
//
8682-
// original tree, of not.
8682+
// original tree, if not.
86838683
//
86848684
inline GenTree* GenTree::gtCommaAssignVal()
86858685
{

src/coreclr/jit/importer.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ GenTree* Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO* sig)
31883188
GenTree* arrayLocalNode = impStackTop(1).val;
31893189

31903190
//
3191-
// Verify that the field token is known and valid. Note that It's also
3191+
// Verify that the field token is known and valid. Note that it's also
31923192
// possible for the token to come from reflection, in which case we cannot do
31933193
// the optimization and must therefore revert to calling the helper. You can
31943194
// see an example of this in bvt\DynIL\initarray2.exe (in Main).
@@ -8108,7 +8108,7 @@ void Compiler::impImportAndPushBox(CORINFO_RESOLVED_TOKEN* pResolvedToken)
81088108
}
81098109

81108110
//------------------------------------------------------------------------
8111-
// impImportNewObjArray: Build and import `new` of multi-dimmensional array
8111+
// impImportNewObjArray: Build and import `new` of multi-dimensional array
81128112
//
81138113
// Arguments:
81148114
// pResolvedToken - The CORINFO_RESOLVED_TOKEN that has been initialized
@@ -8123,7 +8123,7 @@ void Compiler::impImportAndPushBox(CORINFO_RESOLVED_TOKEN* pResolvedToken)
81238123
// Notes:
81248124
// Multi-dimensional array constructors are imported as calls to a JIT
81258125
// helper, not as regular calls.
8126-
8126+
//
81278127
void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_CALL_INFO* pCallInfo)
81288128
{
81298129
GenTree* classHandle = impParentClassTokenToHandle(pResolvedToken);
@@ -8160,7 +8160,7 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI
81608160
// The arguments of the CORINFO_HELP_NEW_MDARR helper are:
81618161
// - Array class handle
81628162
// - Number of dimension arguments
8163-
// - Pointer to block of int32 dimensions - address of lvaNewObjArrayArgs temp.
8163+
// - Pointer to block of int32 dimensions: address of lvaNewObjArrayArgs temp.
81648164
//
81658165

81668166
node = gtNewLclvNode(lvaNewObjArrayArgs, TYP_BLK);
@@ -13695,15 +13695,15 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1369513695
{
1369613696
lclTyp = JITtype2varType(cit);
1369713697
}
13698-
goto ARR_LD_POST_VERIFY;
13698+
goto ARR_LD;
1369913699
}
1370013700

1370113701
// Similarly, if its a readonly access, we can do a simple address-of
1370213702
// without doing a runtime type-check
1370313703
if (prefixFlags & PREFIX_READONLY)
1370413704
{
1370513705
lclTyp = TYP_REF;
13706-
goto ARR_LD_POST_VERIFY;
13706+
goto ARR_LD;
1370713707
}
1370813708

1370913709
// Otherwise we need the full helper function with run-time type check
@@ -13747,7 +13747,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1374713747
tiRetVal = verMakeTypeInfo(ldelemClsHnd); // precise type always needed for struct
1374813748
tiRetVal.NormaliseForStack();
1374913749
}
13750-
goto ARR_LD_POST_VERIFY;
13750+
goto ARR_LD;
1375113751

1375213752
case CEE_LDELEM_I1:
1375313753
lclTyp = TYP_BYTE;
@@ -13784,7 +13784,6 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1378413784
goto ARR_LD;
1378513785

1378613786
ARR_LD:
13787-
ARR_LD_POST_VERIFY:
1378813787

1378913788
op2 = impPopStack().val; // index
1379013789
op1 = impPopStack().val; // array
@@ -15345,14 +15344,14 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1534515344
// Insert the security callout before any actual code is generated
1534615345
impHandleAccessAllowed(callInfo.accessAllowed, &callInfo.callsiteCalloutHelper);
1534715346

15348-
// There are three different cases for new
15349-
// Object size is variable (depends on arguments)
15347+
// There are three different cases for new.
15348+
// Object size is variable (depends on arguments).
1535015349
// 1) Object is an array (arrays treated specially by the EE)
1535115350
// 2) Object is some other variable sized object (e.g. String)
1535215351
// 3) Class Size can be determined beforehand (normal case)
15353-
// In the first case, we need to call a NEWOBJ helper (multinewarray)
15354-
// in the second case we call the constructor with a '0' this pointer
15355-
// In the third case we alloc the memory, then call the constuctor
15352+
// In the first case, we need to call a NEWOBJ helper (multinewarray).
15353+
// In the second case we call the constructor with a '0' this pointer.
15354+
// In the third case we alloc the memory, then call the constuctor.
1535615355

1535715356
clsFlags = callInfo.classFlags;
1535815357
if (clsFlags & CORINFO_FLG_ARRAY)

src/coreclr/jit/lower.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ GenTree* Lowering::LowerNode(GenTree* node)
259259
ContainCheckBoundsChk(node->AsBoundsChk());
260260
break;
261261
#endif // TARGET_XARCH
262+
262263
case GT_ARR_ELEM:
263264
return LowerArrElem(node);
264265

0 commit comments

Comments
 (0)