Skip to content

Include dependently promoted fields in SSA - #77238

Merged
AndyAyersMS merged 8 commits into
dotnet:mainfrom
SingleAccretion:Dependent-Fields-In-SSA-Upstream
Nov 6, 2022
Merged

Include dependently promoted fields in SSA#77238
AndyAyersMS merged 8 commits into
dotnet:mainfrom
SingleAccretion:Dependent-Fields-In-SSA-Upstream

Conversation

@SingleAccretion

@SingleAccretionSingleAccretion commented Oct 19, 2022

Copy link
Copy Markdown
Contributor

Allowing for their participation in the SSA-based optimizations.

This changes two significant IR invariants:

  1. It is not longer a correctness issue for morph to not mark a dependently promoted struct DNER / multi-reg - we remove the one hard requirement for this determination from the front-end. The soft requirement of CQ and making ref counting happy stays.
  2. Uses of promoted locals can now implicitly refer to SSA variables. They are not renamed. The canonical example of such promoted locals are those created for multi-reg returns.

This change also makes lvIsMultiRegRet mostly unnecessary, though I plan to scale back its usage in a separate change.

2nd Round Diffs

@ghostghost added community-contribution Indicates that the PR has been added by a community member area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Oct 19, 2022
@ghost

Copy link
Copy Markdown

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

Issue Details

Allowing for their participation in the SSA-based optimizations.

This changes two significant IR invariant:

  1. It is not longer a correctness issue for morph to not mark a dependently promoted struct DNER / multi-reg - we remove the one hard requirement for this determination from the front-end. The soft requirement of CQ and making ref counting happy stays.
  2. Uses of promoted locals can now implicitly refer to SSA variables. They are not renamed. The canonical example of such promoted locals are those created for multi-reg returns.

This change also makes lvIsMultiRegRet mostly unnecessary, though I plan to scale back its usage in a separate change.

Author:SingleAccretion
Assignees:-
Labels:

area-CodeGen-coreclr, community-contribution

Milestone:-

@SingleAccretion
SingleAccretionforce-pushed the Dependent-Fields-In-SSA-Upstream branch from 295c147 to 497d70aCompareOctober 20, 2022 18:39
 1) The definition of SIMPLE_NUM_COUNT was wrong.
2) SsaNumInfo::Composite, in the compact case, did not clear the old value.
3) SsaNumInfo::Composite, in the outlined case, did not copy the already
(compactly) encoded simple names.
The load path needs to use the offset relative to
the store's target location.
@SingleAccretion
SingleAccretionforce-pushed the Dependent-Fields-In-SSA-Upstream branch from 497d70a to 44238c8CompareOctober 21, 2022 14:17
@SingleAccretion
SingleAccretion marked this pull request as ready for review October 21, 2022 16:38
@SingleAccretion

Copy link
Copy Markdown
ContributorAuthor

@dotnet/jit-contrib

This will need to be stressed and fuzzed.

@EgorBo

Copy link
Copy Markdown
Member

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, Fuzzlyn

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@SingleAccretion

SingleAccretion commented Oct 22, 2022

Copy link
Copy Markdown
ContributorAuthor

The CI results are a bit hard to interpret for known-ness right now (e. g. libraries stress has a little under 900 failures), Fuzzlyn looked clean-ish at least.

@SingleAccretionSingleAccretion mentioned this pull request Oct 23, 2022
@BruceForstall

Copy link
Copy Markdown
Contributor

Stress should be cleaner now.

@BruceForstall

Copy link
Copy Markdown
Contributor

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, Fuzzlyn

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@SingleAccretion

SingleAccretion commented Oct 26, 2022

Copy link
Copy Markdown
ContributorAuthor

Some (aka a lot of) stress (and Fuzzlyn) failures with an assert:

 JIT\Directed\Convert\value_numbering_checked_casts_of_constants\value_numbering_checked_casts_of_constants.cmd [FAIL]
Assert failure(PID 4612 [0x00001204], Thread: 3588 [0x0e04]): Assertion failed 'isCandidateVar(fieldVarDsc) == isMultiReg' in 'ValueNumberingCheckedCastsOfConstants:<TestCastingSingleToInt64>g__ConfirmSingleOneFullDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly|10_27()' during 'Linear scan register alloc' (IL size 92; hash 0xfaebe139; Tier0-MinOpts)
File: D:\a\_work\1\s\src\coreclr\jit\lsrabuild.cpp Line: 1269
Image: C:\h\w\BB5E09CF\p\corerun.exe

Edit: this is fallout from #76263. Fix incoming...

@SingleAccretion

Copy link
Copy Markdown
ContributorAuthor

Apart from the above, failures looked known.

@AndyAyersMS

Copy link
Copy Markdown
Member

Hmm, odd that it got closed -- not sure how this happened.

@SingleAccretion

Copy link
Copy Markdown
ContributorAuthor

Presumably the same curious GH behavior we've seen once, with this line

should fix stress failures

in #77502 to blame...

@AndyAyersMS

Copy link
Copy Markdown
Member

Going to bounce this so it runs with ssa checking.

Comment threadsrc/coreclr/jit/valuenum.cpp Outdated
@AndyAyersMS

Copy link
Copy Markdown
Member

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, Fuzzlyn

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@AndyAyersMS

Copy link
Copy Markdown
Member

libraries jitstress has some known failures; coreclr jitstress was running clean recently.

@SingleAccretion

SingleAccretion commented Nov 4, 2022

Copy link
Copy Markdown
ContributorAuthor

Starting to collect failures.

 # ChildEBP RetAddr 00 02fe9c48 724aa24d coreclr!FailFastOnAssert+0x21 [D:\a\_work\1\s\src\coreclr\utilcode\debug.cpp @ 60] 01 02fe9c48 724a9967 coreclr!_DbgBreakCheck+0x329 [D:\a\_work\1\s\src\coreclr\utilcode\debug.cpp @ 247] 02 02fe9cb8 724a9c91 coreclr!_DbgBreakCheckNoThrow+0x51 [D:\a\_work\1\s\src\coreclr\utilcode\debug.cpp @ 307] 03 02fe9d54 72147fe8 coreclr!DbgAssertDialog+0x20c [D:\a\_work\1\s\src\coreclr\utilcode\debug.cpp @ 459] 04 02fe9dd4 725aff92 coreclr!Thread::DetachThread+0xcf [D:\a\_work\1\s\src\coreclr\vm\threads.cpp @ 981] 05 02fe9e40 725c2396 coreclr!TlsDestructionMonitor::~TlsDestructionMonitor+0x8f [D:\a\_work\1\s\src\coreclr\vm\ceemain.cpp @ 1764] 06 02fe9e58 7727ea4e coreclr!__dyn_tls_dtor+0x86 [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\tls\tlsdtor.cpp @ 123] WARNING: Stack unwind information not available. Following frames may be wrong.
07 02fe9e78 7724eeb6 ntdll!RtlDecompressBuffer+0xde
08 02fe9ec8 772a3c6a ntdll!LdrShutdownThread+0x386
09 02fe9f10 77262d7f ntdll!LdrSetAppCompatDllRedirectionCallback+0x1052a
0a 02fe9fa8 77263886 ntdll!LdrShutdownProcess+0x15f
0b 02fea07c 7689b3e3 ntdll!RtlExitUserProcess+0x96
0c 02fea090 00000000 kernel32!ExitProcess+0x13

@SingleAccretion

Copy link
Copy Markdown
ContributorAuthor

The failures have been accounted for above, I believe all are known.

@AndyAyersMS
AndyAyersMS merged commit 6bae351 into dotnet:mainNov 6, 2022
@SingleAccretion
SingleAccretion deleted the Dependent-Fields-In-SSA-Upstream branch November 6, 2022 17:45
@kunalspathak

kunalspathak commented Nov 7, 2022

Copy link
Copy Markdown
Contributor

Some (aka a lot of) stress (and Fuzzlyn) failures with an assert:

 JIT\Directed\Convert\value_numbering_checked_casts_of_constants\value_numbering_checked_casts_of_constants.cmd [FAIL]
Assert failure(PID 4612 [0x00001204], Thread: 3588 [0x0e04]): Assertion failed 'isCandidateVar(fieldVarDsc) == isMultiReg' in 'ValueNumberingCheckedCastsOfConstants:<TestCastingSingleToInt64>g__ConfirmSingleOneFullDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly|10_27()' during 'Linear scan register alloc' (IL size 92; hash 0xfaebe139; Tier0-MinOpts)
File: D:\a\_work\1\s\src\coreclr\jit\lsrabuild.cpp Line: 1269
Image: C:\h\w\BB5E09CF\p\corerun.exe

Edit: this is fallout from #76263. Fix incoming...

This was also hit in Antigen in yesterday's run. Was this ever fixed?
Edit: It was on linux/arm

@SingleAccretion

SingleAccretion commented Nov 7, 2022

Copy link
Copy Markdown
ContributorAuthor

Was this ever fixed?

Yes, it was fixed in #77502. Evidently not fully...

@EgorBo

Copy link
Copy Markdown
Member

Improvements on arm64-ubuntu: dotnet/perf-autofiling-issues#9679

@ghostghost locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@SingleAccretion@EgorBo@BruceForstall@AndyAyersMS@kunalspathak