Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve LSRA and other dump output #71499

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4698,6 +4698,7 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
// Figure out what locals are address-taken.
//
DoPhase(this, PHASE_STR_ADRLCL, &Compiler::fgMarkAddressExposedLocals);

// Run a simple forward substitution pass.
//
DoPhase(this, PHASE_FWD_SUB, &Compiler::fgForwardSub);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ GenTree* Compiler::fgCreateMonitorTree(unsigned lvaMonAcquired, unsigned lvaThis
{
// have to insert this immediately before the GT_RETURN so we transform:
// ret(...) ->
// ret(comma(comma(tmp=...,call mon_exit), tmp)
// ret(comma(comma(tmp=...,call mon_exit), tmp))
//
//
// Before morph stage, it is possible to have a case of GT_RETURN(TYP_LONG, op1) where op1's type is
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ struct GenTree
return (gtOper == GT_LCL_FLD || gtOper == GT_LCL_FLD_ADDR || gtOper == GT_STORE_LCL_FLD);
}

inline bool OperIsLocalField() const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline is implicit for function definitions within the body of a class declaration, so this is just to be consistent with all other cases that don't use it.

bool OperIsLocalField() const
{
return OperIsLocalField(gtOper);
}
Expand Down Expand Up @@ -8558,13 +8558,13 @@ inline GenTree* GenTree::gtEffectiveVal(bool commaOnly /* = false */)
}

//-------------------------------------------------------------------------
// gtCommaAssignVal - find value being assigned to a comma wrapped assigment
// gtCommaAssignVal - find value being assigned to a comma wrapped assignment
//
// Returns:
// tree representing value being assigned if this tree represents a
// comma-wrapped local definition and use.
//
// original tree, of not.
// original tree, if not.
//
inline GenTree* GenTree::gtCommaAssignVal()
{
Expand Down
25 changes: 12 additions & 13 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3186,7 +3186,7 @@ GenTree* Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO* sig)
GenTree* arrayLocalNode = impStackTop(1).val;

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

//------------------------------------------------------------------------
// impImportNewObjArray: Build and import `new` of multi-dimmensional array
// impImportNewObjArray: Build and import `new` of multi-dimensional array
//
// Arguments:
// pResolvedToken - The CORINFO_RESOLVED_TOKEN that has been initialized
Expand All @@ -7970,7 +7970,7 @@ void Compiler::impImportAndPushBox(CORINFO_RESOLVED_TOKEN* pResolvedToken)
// Notes:
// Multi-dimensional array constructors are imported as calls to a JIT
// helper, not as regular calls.

//
void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_CALL_INFO* pCallInfo)
{
GenTree* classHandle = impParentClassTokenToHandle(pResolvedToken);
Expand Down Expand Up @@ -8007,7 +8007,7 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI
// The arguments of the CORINFO_HELP_NEW_MDARR helper are:
// - Array class handle
// - Number of dimension arguments
// - Pointer to block of int32 dimensions - address of lvaNewObjArrayArgs temp.
// - Pointer to block of int32 dimensions: address of lvaNewObjArrayArgs temp.
//

node = gtNewLclvNode(lvaNewObjArrayArgs, TYP_BLK);
Expand Down Expand Up @@ -13552,15 +13552,15 @@ void Compiler::impImportBlockCode(BasicBlock* block)
{
lclTyp = JITtype2varType(cit);
}
goto ARR_LD_POST_VERIFY;
goto ARR_LD;
}

// Similarly, if its a readonly access, we can do a simple address-of
// without doing a runtime type-check
if (prefixFlags & PREFIX_READONLY)
{
lclTyp = TYP_REF;
goto ARR_LD_POST_VERIFY;
goto ARR_LD;
}

// Otherwise we need the full helper function with run-time type check
Expand Down Expand Up @@ -13604,7 +13604,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
tiRetVal = verMakeTypeInfo(ldelemClsHnd); // precise type always needed for struct
tiRetVal.NormaliseForStack();
}
goto ARR_LD_POST_VERIFY;
goto ARR_LD;

case CEE_LDELEM_I1:
lclTyp = TYP_BYTE;
Expand Down Expand Up @@ -13641,7 +13641,6 @@ void Compiler::impImportBlockCode(BasicBlock* block)
goto ARR_LD;

ARR_LD:
ARR_LD_POST_VERIFY:

op2 = impPopStack().val; // index
op1 = impPopStack().val; // array
Expand Down Expand Up @@ -15202,14 +15201,14 @@ void Compiler::impImportBlockCode(BasicBlock* block)
// Insert the security callout before any actual code is generated
impHandleAccessAllowed(callInfo.accessAllowed, &callInfo.callsiteCalloutHelper);

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

clsFlags = callInfo.classFlags;
if (clsFlags & CORINFO_FLG_ARRAY)
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ GenTree* Lowering::LowerNode(GenTree* node)
ContainCheckBoundsChk(node->AsBoundsChk());
break;
#endif // TARGET_XARCH

case GT_ARR_ELEM:
return LowerArrElem(node);

Expand Down
Loading