-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix HFA/HVA classification #37499
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
Fix HFA/HVA classification #37499
Conversation
sandreenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jit/ToolBox changes look good, with one question about compFloatingPointUsed.
I like how clean it looks with DOUBLE\Vector64 separation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe to drop compFloatingPointUsed = true;?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that was a mistake
src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_35144/Runtime_35144.cs
Outdated
Show resolved
Hide resolved
|
@davidwrighton - the crossgen2 tests are failing in CI, but passing on my local system. Can you advise me what I might be missing? |
|
@dotnet/dnceng - is this a known issue? I see it on two of my PRs, and at least one other as well: |
|
@CarolEidt looks like folks are aware and fixed it already here: #37626 Rebase should get you going. Meanwhile we are looking into improving the process so that this doesn't happen again. |
|
@jkoritzinsky @davidwrighton @sandreenko PTAL |
sandreenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jit/ToolBox changes LGTM.
|
ping @jkoritzinsky @davidwrighton |
| CORINFO_HFA_ELEM_FLOAT, | ||
| CORINFO_HFA_ELEM_DOUBLE, | ||
| CORINFO_HFA_ELEM_VECTOR64, | ||
| CORINFO_HFA_ELEM_VECTOR128, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There aren't any architectures that have HVA for Vector256?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like __vectorcall for x64 will eventually fit this bill: https://godbolt.org/z/DMX7Y2, but not for ARM32/ARM64 (which don't support Vector256<T>) nor the default calling conventions for x86 or x64 on Unix/Windows.
System V does treat a simple wrapper over __m256 as if it was directly __m256 however, not sure if that is classified as an HFA/HVA by the JIT...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the runtime (JIT + VM) handles the System V ABI completely separately. HFA/HVA is ARM32/ARM64 only.
|
The changes make sense to me. I imagine the same code paths would need to be updated when |
| CORINFO_HFA_ELEM_VECTOR64, | ||
| CORINFO_HFA_ELEM_VECTOR128, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically VECTOR64 and VECTOR128 are HVAs, not HFAs. For that reason I have renamed HFA to either HA or HomogenousAggregate everywhere in managed code. If we introduce and expose a new enumeration, I would prefer to name it correctly from the beginning. However, I realize there are lots of hfa usage in JIT code, so leaving it up to you.
I confess that I haven't looked at the ABI requirements for |
jkoritzinsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VM interop code LGTM
davidwrighton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as the change to the product goes, it looks ok, although sufficiently complex that I don't have complete confidence that I can review it to complete correctness. So I've made some suggestions of making the test more complex in ways that will cause our various automated runs to find bugs more effectively.
| static class Runtime_35144 | ||
| { | ||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| static void Foo<T>(T x) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this test to pass an object after the T parameter? I would like it for GC Stress to cover the case where we use the calling convention processing logic of the VM to parse all of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular make the function be written as:
static void Foo<T>(T x, object o)
{
if (o.GetType() != typeof(string)) throw new Exception();
if (((string)o) != "SomeString") throw new Exception();
}
and call it passing a string "SomeString" as the extra parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you could mark the Foo method as AggressiveOptimization so that it isn't compiled by crossgen that will also help chase down the case where crossgen compiles this different from what the normal runtime does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidwrighton - Thanks for the review, and for the suggestions for improving the test!
Closes dotnet#36206, closes dotnet#36418. The issue was fixed by dotnet#37499.
* Reenable GitHub_26491. Closes #13355 * Reenable crossgen2 tests failing with old retyping/ They were fixed both with and without retyping. Closes #37883. * Reenable HVA merge cases. Closes #37341, closes #37880. * Reenable GitHub_35821. Closes #36206, closes #36418. The issue was fixed by #37499. * Delete extra lines that are no longer needed. #37506 was fixed in #38241. * delete a throwing init.
Fix #35144 and #35976