Skip to content

Add 10 when digit is [a-fA-F] in ConfigMethodRange::InitRanges#39754

Merged
echesakov merged 2 commits into
dotnet:masterfrom
echesakov:ConfigMethodRange-InitRanges
Jul 24, 2020
Merged

Add 10 when digit is [a-fA-F] in ConfigMethodRange::InitRanges#39754
echesakov merged 2 commits into
dotnet:masterfrom
echesakov:ConfigMethodRange-InitRanges

Conversation

@echesakov
Copy link
Copy Markdown
Contributor

Fix small issue that broke JitStressRange after 6dd6b6c

@echesakov echesakov added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 22, 2020
@echesakov echesakov requested a review from AndyAyersMS July 22, 2020 03:14
Copy link
Copy Markdown
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Thanks. That may explain why I was still having trouble using this...

@echesakov
Copy link
Copy Markdown
Contributor Author

There is another problem at

bRangeAllowStress = fJitStressRange.Contains(info.compMethodHash());

When we execute info.compMethodHash https://github.com/dotnet/runtime/blob/master/src/coreclr/src/jit/compiler.cpp#L5492-L5504 compMethodHashPrivate is not initialized yet and contains either an arbitrary value (in rel) or 0xdddddddd (in dbg).

This is what happens when I set COMPlus_JitStressRange=dddddddd. Basically, all methods are got jit-stressed

root@e489b5beca1a:/opt/code/artifacts/tests/coreclr/Linux.arm64.Checked/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r# COMPlus_DumpJittedMethods=1 COMPlus_JitStress=2 COMPlus_JitStressRange=dddddddd $CORE_ROOT/corerun Vector256_1_r.dll AllBitsSet.UInt16
Compiling    0 System.Runtime.CompilerServices.CastHelpers::StelemRef, IL size = 86, hash=0x1b5e9e9c FullOpts JitStress
Compiling    1 System.Runtime.CompilerServices.CastHelpers::LdelemaRef, IL size = 42, hash=0xd1234a96 Tier-1/FullOpts switched to MinOpts JitStress
Compiling    2 System.SpanHelpers::IndexOf, IL size = 1068, hash=0x576e6ccc FullOpts JitStress
Compiling    3 System.Runtime.Intrinsics.Vector128::Create, IL size = 28, hash=0xabf13899 FullOpts JitStress
Compiling    4 System.Runtime.Intrinsics.Vector128::AsByte, IL size = 7, hash=0x9122c64b Tier-1/FullOpts switched to MinOpts JitStress
Compiling    5 JIT.HardwareIntrinsics.General.Program::Main, IL size = 139, hash=0x8ad3a46d MinOpts JitStress
Compiling    6 JIT.HardwareIntrinsics.General.Program::.cctor, IL size = 2582, hash=0xe03e8610 MinOpts JitStress
Compiling    7 JIT.HardwareIntrinsics.General.Program::GetTestsToRun, IL size = 130, hash=0x38c23919 MinOpts JitStress
Compiling    8 System.Linq.Enumerable::Contains, IL size = 123, hash=0x13ce4c0d FullOpts JitStress
Compiling    9 TestLibrary.TestFramework::BeginTestCase, IL size = 150, hash=0x2feb4048 FullOpts JitStress
Compiling   10 TestLibrary.Generator::.cctor, IL size = 22, hash=0x95396aed Tier-1/FullOpts switched to MinOpts JitStress
Compiling   11 System.SpanHelpers::Contains, IL size = 297, hash=0xabfb7545 FullOpts JitStress
Compiling   12 System.SpanHelpers::IndexOf, IL size = 1001, hash=0xe0a010d4 FullOpts JitStress
Compiling   13 System.Runtime.Intrinsics.Vector128::AsByte, IL size = 7, hash=0x1cf43828 FullOpts JitStress
Compiling   14 System.Runtime.Intrinsics.Vector128::AsUInt64, IL size = 7, hash=0xdf1a5005 FullOpts JitStress
Compiling   15 System.Runtime.Intrinsics.Vector128::ToScalar, IL size = 18, hash=0x1ca6dde8 FullOpts JitStress
Compiling   16 System.SpanHelpers::IndexOfAny, IL size = 423, hash=0x41e07991 FullOpts JitStress
Compiling   17 ILStubClass::IL_STUB_ReversePInvoke, IL size = 52, hash=0x1554399c FullOpts JitStress
Compiling   18 System.SpanHelpers::SequenceCompareTo, IL size = 309, hash=0xbda601aa FullOpts JitStress
Compiling   19 System.Console::WriteLine, IL size = 12, hash=0x450bf92f FullOpts JitStress
Compiling   20 System.Console::.cctor, IL size = 11, hash=0x701237e5 Tier-1/FullOpts switched to MinOpts JitStress
Compiling   21 System.Console::<get_Out>g__EnsureInitialized|25_0, IL size = 63, hash=0x062f85e9 FullOpts JitStress
Compiling   22 System.ConsolePal::OpenStandardOutput, IL size = 43, hash=0x173bd4aa FullOpts JitStress
Compiling   23 <>c::.cctor, IL size = 11, hash=0x7a92f338 Tier-1/FullOpts switched to MinOpts JitStress
Compiling   24 <>c::.ctor, IL size = 7, hash=0xcce2e927 FullOpts JitStress
Compiling   25 <>c::<OpenStandardOutput>b__9_0, IL size = 11, hash=0x8d7e91a1 FullOpts JitStress
Compiling   26 FileDescriptors::.cctor, IL size = 34, hash=0x29a8927f Tier-1/FullOpts switched to MinOpts JitStress
Compiling   27 FileDescriptors::CreateFileHandle, IL size = 13, hash=0x52e72907 FullOpts JitStress
Compiling   28 ILStubClass::IL_STUB_PInvoke, IL size = 79, hash=0x9ca0dbaa FullOpts JitStress
Compiling   29 System.Console::CreateOutputWriter, IL size = 50, hash=0x8abcf282 FullOpts JitStress
Compiling   30 System.Console::get_OutputEncoding, IL size = 72, hash=0x2b0acc16 FullOpts JitStress
Compiling   31 System.ConsolePal::GetConsoleEncoding, IL size = 23, hash=0x63b461bc FullOpts JitStress
Compiling   32 System.Text.EncodingHelper::GetEncodingFromCharset, IL size = 25, hash=0x2d07865b FullOpts JitStress
Compiling   33 System.Text.EncodingHelper::GetCharset, IL size = 120, hash=0x5fb34eab FullOpts JitStress
Compiling   34 System.Text.EncodingHelper::.cctor, IL size = 36, hash=0xb28e5a04 Tier-1/FullOpts switched to MinOpts JitStress
Compiling   35 System.Text.EncodingExtensions::RemovePreamble, IL size = 25, hash=0x02a7f0d3 FullOpts JitStress
Compiling   36 System.IO.ConsoleStream::get_CanWrite, IL size = 7, hash=0xfcc48126 FullOpts JitStress
Compiling   37 System.IO.ConsoleStream::get_CanSeek, IL size = 2, hash=0xc1997943 FullOpts JitStress
Compiling   38 UnixConsoleStream::Flush, IL size = 26, hash=0x39be8ac7 FullOpts JitStress
Compiling   38 UnixConsoleStream::Flush, IL size = 26, hash=0x39be8ac7 MinOpts JitStress
Compiling   39 System.IO.ConsoleStream::Flush, IL size = 15, hash=0x0b5b804e FullOpts JitStress
Compiling   40 UnixConsoleStream::Write, IL size = 25, hash=0x59ed5039 FullOpts JitStress
Compiling   41 System.IO.ConsoleStream::ValidateWrite, IL size = 83, hash=0x489d9676 FullOpts JitStress

@echesakov
Copy link
Copy Markdown
Contributor Author

cc @dotnet/jit-contrib in case if someone tries to use JitStressRange

@echesakov
Copy link
Copy Markdown
Contributor Author

I think the second issue was introduced by #38103 and could be fixed by moving the following lines https://github.com/dotnet/runtime/blob/master/src/coreclr/src/jit/compiler.cpp#L5290-L5292 from Compiler::compCompile to Compiler::compInit to make info.compMethodHashPrivate zero-ed before a call to info.compMethodHash().

@CarolEidt Does this sound reasonable?

@AntonLapounov
Copy link
Copy Markdown
Member

I do not think the "Check for overflow" immediately after the fix or m_badChar handling are correct either.

Copy link
Copy Markdown
Contributor

@briansull briansull left a comment

Choose a reason for hiding this comment

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

LGTM

@echesakov
Copy link
Copy Markdown
Contributor Author

I do not think the "Check for overflow" immediately after the fix or m_badChar handling are correct either.

@AntonLapounov Yeah, I think you are right but I would like to fix JitStressRange first since it doesn't work even with a valid string now. We should look at overflow check and bad character logic.

@echesakov
Copy link
Copy Markdown
Contributor Author

@dotnet/jit-contrib I just pushed another change required for fixing the JitStressRange as per #39754 (comment). Can someone please sign off one more time?

@echesakov echesakov merged commit 8782d4b into dotnet:master Jul 24, 2020
@echesakov echesakov deleted the ConfigMethodRange-InitRanges branch July 24, 2020 22:48
Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this pull request Aug 10, 2020
* Add 10 when digit is [a-fA-F] in ConfigMethodRange::InitRanges in utils.cpp

* Zero out compMethodHashPrivate earlier in Compiler::compInit() in compiler.cpp
@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
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.

6 participants