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

[JIT] ARM64 Fix - Use SetOper instead of ChangeOper to preserve flags #85076

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

TIHan
Copy link
Member

@TIHan TIHan commented Apr 19, 2023

Description

Resolves #84966

The changes from #84605 resulted in the failing test.

I narrowed down the IL to this:

	ldc.r4		ZERO
	ldc.r4		NAN
	bge.un PASS
	br FAIL

This is an unordered comparison against a float ZERO and float NAN. In the importer, when we see this, the GTF_RELOP_NAN_UN flag gets set on the relop. However, if we decide to later swap the relop, calling ChangeOper will clear this bit which is what resulted in the test failing.

The fix is to use SetOper as it will not clear this flag.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 19, 2023
@ghost ghost assigned TIHan Apr 19, 2023
@ghost
Copy link

ghost commented Apr 19, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Resolves #84966

The changes from #84605 resulted in the failing test.

I narrowed down the IL to this:

	ldc.r4		ZERO
	ldc.r4		NAN
	bge.un PASS
	br FAIL

This is an unordered comparison against a float ZERO and float NAN. In the importer, when we see this, the GTF_RELOP_NAN_UN flag gets set on the relop. However, if we decide to later swap the relop, calling SetOper will clear this bit which is what resulted in the test failing.

I added gtSwapRelop to take into account the GTF_RELOP_NAN_UN flag to make sure it remains on the relop.

Author: TIHan
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@TIHan
Copy link
Member Author

TIHan commented Apr 19, 2023

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TIHan
Copy link
Member Author

TIHan commented Apr 20, 2023

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TIHan TIHan force-pushed the arm-unordered-float-cmp-fix branch from 8b9c63c to 166babb Compare April 20, 2023 16:10
@TIHan TIHan changed the title [JIT] ARM64 Fix - Added 'gtSwapRelop' to take into account the unordered nan flag [JIT] ARM64 Fix - Use SetOper instead of ChangeOper to preserve flags Apr 20, 2023
@TIHan
Copy link
Member Author

TIHan commented Apr 20, 2023

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TIHan
Copy link
Member Author

TIHan commented Apr 20, 2023

@dotnet/jit-contrib This is ready. // cc @jakobbotsch

@TIHan TIHan merged commit 614d683 into dotnet:main Apr 20, 2023
@TIHan TIHan deleted the arm-unordered-float-cmp-fix branch April 20, 2023 19:02
@ghost ghost locked as resolved and limited conversation to collaborators May 21, 2023
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JitStress] JIT/IL_Conformance/Old/Conformance_Base/bge_un* failures
4 participants