Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Update var life for multireg local #21535

Merged
merged 1 commit into from
Dec 15, 2018
Merged

Conversation

CarolEidt
Copy link

When a multi-reg var is defined by a call, but doesn't currently reside in a register,
we must still update liveness.

Fix #21500

When a multi-reg var is defined by a call, but doesn't currently reside in a register,
we must still update liveness.

Fix #21500
@CarolEidt
Copy link
Author

@dotnet/jit-contrib PTAL

@CarolEidt
Copy link
Author

test OSX10.12 x64 Checked Innerloop Build and Test
test Ubuntu x64 Checked CoreFX Tests
test Windows_NT arm Cross Checked Innerloop Build and Test

Copy link

@sandreenko sandreenko left a comment

Choose a reason for hiding this comment

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

@CarolEidt could you please explain the general rule that we use to decide were we need to call genUpdateLife for stack location?

Looking at codegenarm64.cpp I see different cases:
genCodeForStoreLclVar updates for both cases;

genLockedInstructions updates only for registers, is it another missed case that we do not have a repro for or we need an assert that reg != REG_NA?

if (treeNode->gtRegNum != REG_NA)
{
genProduceReg(treeNode);
}
}

The same for genCodeForStoreLclVar, genCodeForCompare,.

@CarolEidt
Copy link
Author

could you please explain the general rule that we use to decide were we need to call genUpdateLife for stack location?

It needs to be called whenever the node is a tracked lclVar. Note that genProduceReg, in addition to updating liveness (in the lclVar case), also takes care of any necessary reload from spill (in the more general case).

@sandreenko
Copy link

sandreenko commented Dec 14, 2018

It needs to be called whenever the node is a tracked lclVar. Note that genProduceReg, in addition to updating liveness (in the lclVar case), also takes care of any necessary reload from spill (in the more general case).

So do we need to call it in genLockedInstructions, genCodeForStoreLclVar, and genCodeForCompare?

@CarolEidt
Copy link
Author

So do we need to call it in genLockedInstructions, genCodeForStoreLclVar, and genCodeForCompare?

It is already being called in genCodeForeStoreLclVar for the non-multireg-call case here: https://github.com/dotnet/coreclr/blob/master/src/jit/codegenarm64.cpp#L1759

It doesn't need to be called for the other two you mention because they are not lclVars. They may consume lclVars, in which case the genConsumeReg will take care of the liveness (note that on arm and arm64 we don't have contained nodes so we don't need to worry about taking care of liveness for a non-reg operand).

Copy link

@sandreenko sandreenko left a comment

Choose a reason for hiding this comment

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

LGTM, thank you.

@CarolEidt CarolEidt merged commit ca65764 into dotnet:master Dec 15, 2018
@CarolEidt CarolEidt deleted the Fix21500 branch February 1, 2019 17:11
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Update var life for multireg local

Commit migrated from dotnet/coreclr@ca65764
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants