-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix ElidedBoundsChecks test failure under jitstress_isas_nohwintrinsic #123881
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
Conversation
…its tests The CountDigits method relies on hardware intrinsics (specifically Lzcnt) to efficiently optimize bounds checks. When running with jitstress_isas_nohwintrinsic, these intrinsics are disabled, causing bounds checks to remain in the generated code and the test to fail. This fix wraps the CountDigits test calls in a conditional check that only runs them when Lzcnt.X64.IsSupported or ArmBase.Arm64.IsSupported is true. Co-authored-by: EgorBo <[email protected]>
|
/azp list |
This comment was marked as resolved.
This comment was marked as resolved.
|
/azp run runtime-coreclr jitstress-isas-x86 |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull request overview
This PR fixes a test failure in ElidedBoundsChecks that occurs when running with jitstress_isas_nohwintrinsic. The CountDigits method relies on ulong.Log2() which requires Lzcnt (x64) or ArmBase (ARM64) hardware intrinsics for the JIT to elide bounds checks. Without these intrinsics, the implementation falls back to software methods that prevent the optimization.
Changes:
- Added runtime guards to skip
CountDigitstest invocations when hardware intrinsics (Lzcnt.X64 or ArmBase.Arm64) are unavailable - Added required namespace imports (
System.Runtime.Intrinsics.ArmandSystem.Runtime.Intrinsics.X86) to support the intrinsic checks
|
/azp run runtime-coreclr jitstress-isas-x86 |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
PTAL @dotnet/jit-contrib simple fix - outerloop pipeline ran this FILECHECK test with HWIntrinsics=0 - it led to |
Description
The
CountDigitsmethod usesulong.Log2()which requires hardware intrinsics (Lzcnt on x64, ArmBase on ARM64) for the JIT to elide bounds checks on the array access. When run withjitstress_isas_nohwintrinsic, the bounds check remains, causing the test'sX64-NOT: CORINFO_HELP_RNGCHKFAILassertion to fail.Changes
CountDigitstest invocations to only execute whenLzcnt.X64.IsSupported || ArmBase.Arm64.IsSupportedTest now skips
CountDigitsvalidation when hardware intrinsics are unavailable, while still validating other bounds check elision scenarios.Original prompt
This section details on the original issue you should resolve
<issue_title>Test Failure: JIT/opt/RangeChecks/ElidedBoundsChecks/ElidedBoundsChecks.cmd</issue_title>
<issue_description>Failed in: runtime-coreclr jitstress-isas-x86 20260131.2
Failed tests:
Error message:
Stack trace: