dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.41k stars 197 forks source link

[NativeAOT-LLVM] Ilc failure in PHASE_EARLY_PROP #2683

Open yowl opened 2 weeks ago

yowl commented 2 weeks ago

Requires more investigation but:

BBF_HAS_IDX_LEN is not set on BB03 but is required because of the following tree
N003 (  3,  3) [000084] ---X-------                         *  ARR_LENGTH int
N002 (  1,  1) [000085] -----------                         \--*  LCL_VAR   ref    V03 loc0         u:2
ILC: E:\GitHub\runtimelab\src\coreclr\jit\earlyprop.cpp:66
ILC: Assertion failed 'false' in 'SixLabors.ImageSharp.Formats.Tiff.TiffDecoderCore:ConvertNumbers(System.Array,byref):System.Buffers.IMemoryOwner`1[ulong]:this' during 'Early Value Propagation' (IL size 94; hash 0xb94995b5; FullOpts)
yowl commented 2 weeks ago

jit dump EGitHubruntimelabartifactsbincoreclrwindows.x64.Debugilcnet9.0ilc.exe.txt

yowl commented 2 weeks ago

Patch from discord, thanks @EgorBo 0001-test.patch Gets past this error, but the same method asserts on the second noway_assert


unsigned SsaRenameState::Top(unsigned lclNum)
{
    noway_assert(m_stacks != nullptr);
    StackNode* top = m_stacks[lclNum].Top();
    noway_assert(top != nullptr);

    DBG_SSA_JITDUMP("[SsaRenameState::Top] " FMT_BB ", V%02u, ssaNum = %d\n", top->m_block->bbNum, lclNum,
                    top->m_ssaNum);

    return top->m_ssaNum;
}
[EGitHubruntimelabartifactsbincoreclrwindows.x64.Debugilcnet9.0ilc.exe.txt](https://github.com/user-attachments/files/16970759/EGitHubruntimelabartifactsbincoreclrwindows.x64.Debugilcnet9.0ilc.exe.txt)

Last 32K lines of new Jit dump
yowl commented 2 weeks ago

EGitHubruntimelabartifactsbincoreclrwindows.x64.Debugilcnet9.0ilc.exe.txt

EgorBo commented 2 weeks ago

The initial issue is addressed in the upstream via https://github.com/dotnet/runtime/pull/107790