Skip to content

Commit

Permalink
Run jit-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbotsch committed Dec 17, 2024
1 parent e504b4b commit bf196bd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
9 changes: 5 additions & 4 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3258,8 +3258,8 @@ void CodeGen::genSpillOrAddRegisterParam(unsigned lclNum, const ABIPassingSegmen

if (varDsc->lvOnFrame && (!varDsc->lvIsInReg() || varDsc->lvLiveInOutOfHndlr))
{
unsigned paramLclNum = varDsc->lvIsStructField ? varDsc->lvParentLcl : lclNum;
LclVarDsc* paramVarDsc = compiler->lvaGetDesc(paramLclNum);
unsigned paramLclNum = varDsc->lvIsStructField ? varDsc->lvParentLcl : lclNum;
LclVarDsc* paramVarDsc = compiler->lvaGetDesc(paramLclNum);

var_types storeType = genParamStackType(paramVarDsc, segment);
if ((varDsc->TypeGet() != TYP_STRUCT) && (genTypeSize(genActualType(varDsc)) < genTypeSize(storeType)))
Expand Down Expand Up @@ -3396,7 +3396,7 @@ void CodeGen::genHomeRegisterParams(regNumber initReg, bool* initRegStillZeroed)

for (unsigned lclNum = 0; lclNum < compiler->info.compArgsCount; lclNum++)
{
LclVarDsc* lclDsc = compiler->lvaGetDesc(lclNum);
LclVarDsc* lclDsc = compiler->lvaGetDesc(lclNum);
const ABIPassingInformation& abiInfo = compiler->lvaGetParameterABIInfo(lclNum);

for (const ABIPassingSegment& segment : abiInfo.Segments())
Expand All @@ -3406,7 +3406,8 @@ void CodeGen::genHomeRegisterParams(regNumber initReg, bool* initRegStillZeroed)
continue;
}

const RegisterParameterLocalMapping* mapping = compiler->FindParameterRegisterLocalMappingByRegister(segment.GetRegister());
const RegisterParameterLocalMapping* mapping =
compiler->FindParameterRegisterLocalMappingByRegister(segment.GetRegister());

unsigned fieldLclNum = mapping != nullptr ? mapping->LclNum : lclNum;
genSpillOrAddRegisterParam(fieldLclNum, segment, &graph);
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4260,7 +4260,8 @@ const RegisterParameterLocalMapping* Compiler::FindParameterRegisterLocalMapping
// Returns:
// The mapping, or nullptr if no mapping was found for this local.
//
const RegisterParameterLocalMapping* Compiler::FindParameterRegisterLocalMappingByLocal(unsigned lclNum, unsigned offset)
const RegisterParameterLocalMapping* Compiler::FindParameterRegisterLocalMappingByLocal(unsigned lclNum,
unsigned offset)
{
if (m_regParamLocalMappings == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8316,7 +8316,7 @@ class Compiler
bool rpMustCreateEBPFrame(INDEBUG(const char** wbReason));

private:
Lowering* m_pLowering = nullptr; // Lowering; needed to Lower IR that's added or modified after Lowering.
Lowering* m_pLowering = nullptr; // Lowering; needed to Lower IR that's added or modified after Lowering.
LinearScanInterface* m_pLinearScan = nullptr; // Linear Scan allocator

public:
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/jit/liveness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,8 @@ void Compiler::fgInterBlockLocalVarLiveness()
// liveness of such locals will bubble to the top (fgFirstBB)
// in fgInterBlockLocalVarLiveness()

if (!varDsc->lvIsParam && !varDsc->lvIsParamRegTarget && VarSetOps::IsMember(this, fgFirstBB->bbLiveIn, varDsc->lvVarIndex) &&
if (!varDsc->lvIsParam && !varDsc->lvIsParamRegTarget &&
VarSetOps::IsMember(this, fgFirstBB->bbLiveIn, varDsc->lvVarIndex) &&
(info.compInitMem || varTypeIsGC(varDsc->TypeGet())) && !fieldOfDependentlyPromotedStruct)
{
varDsc->lvMustInit = true;
Expand Down
9 changes: 5 additions & 4 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7914,12 +7914,13 @@ PhaseStatus Lowering::DoPhase()
//
void Lowering::MapParameterRegisterLocals()
{
comp->m_regParamLocalMappings = new (comp, CMK_ABI) ArrayStack<RegisterParameterLocalMapping>(comp->getAllocator(CMK_ABI));
comp->m_regParamLocalMappings =
new (comp, CMK_ABI) ArrayStack<RegisterParameterLocalMapping>(comp->getAllocator(CMK_ABI));

// Create initial mappings for promotions.
for (unsigned lclNum = 0; lclNum < comp->info.compArgsCount; lclNum++)
{
LclVarDsc* lclDsc = comp->lvaGetDesc(lclNum);
LclVarDsc* lclDsc = comp->lvaGetDesc(lclNum);
const ABIPassingInformation& abiInfo = comp->lvaGetParameterABIInfo(lclNum);

if (abiInfo.HasAnyStackSegment())
Expand All @@ -7934,8 +7935,8 @@ void Lowering::MapParameterRegisterLocals()

for (int i = 0; i < lclDsc->lvFieldCnt; i++)
{
unsigned fieldLclNum = lclDsc->lvFieldLclStart + i;
LclVarDsc* fieldDsc = comp->lvaGetDesc(fieldLclNum);
unsigned fieldLclNum = lclDsc->lvFieldLclStart + i;
LclVarDsc* fieldDsc = comp->lvaGetDesc(fieldLclNum);

for (const ABIPassingSegment& segment : abiInfo.Segments())
{
Expand Down
11 changes: 7 additions & 4 deletions src/coreclr/jit/lsrabuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2185,10 +2185,12 @@ void LinearScan::buildIntervals()
continue;
}

const RegisterParameterLocalMapping* mapping = compiler->FindParameterRegisterLocalMappingByRegister(seg.GetRegister());
const RegisterParameterLocalMapping* mapping =
compiler->FindParameterRegisterLocalMappingByRegister(seg.GetRegister());

LclVarDsc* argDsc = compiler->lvaGetDesc(mapping != nullptr ? mapping->LclNum : lclNum);
if (argDsc->lvTracked && !compiler->compJmpOpUsed && (argDsc->lvRefCnt() == 0) && !compiler->opts.compDbgCode)
if (argDsc->lvTracked && !compiler->compJmpOpUsed && (argDsc->lvRefCnt() == 0) &&
!compiler->opts.compDbgCode)
{
// Not live
continue;
Expand All @@ -2201,7 +2203,7 @@ void LinearScan::buildIntervals()

for (unsigned int varIndex = 0; varIndex < compiler->lvaTrackedCount; varIndex++)
{
unsigned lclNum = compiler->lvaTrackedIndexToLclNum(varIndex);
unsigned lclNum = compiler->lvaTrackedIndexToLclNum(varIndex);
LclVarDsc* lclDsc = compiler->lvaGetDesc(lclNum);

if (!isCandidateVar(lclDsc))
Expand All @@ -2223,7 +2225,8 @@ void LinearScan::buildIntervals()
regNumber paramReg = REG_NA;
if (lclDsc->lvIsParamRegTarget)
{
const RegisterParameterLocalMapping* mapping = compiler->FindParameterRegisterLocalMappingByLocal(lclNum, 0);
const RegisterParameterLocalMapping* mapping =
compiler->FindParameterRegisterLocalMappingByLocal(lclNum, 0);
assert(mapping != nullptr);
paramReg = mapping->RegisterSegment->GetRegister();
}
Expand Down

0 comments on commit bf196bd

Please sign in to comment.