Commit c635ae2
Adding new ReadyToRun helper for static cctor (#76898)
* Adding new ReadyToRun helper for static cctor
When accessing a static field the static cctor of the class is
called. Then the helper CORINFO_HELP_READYTORUN_STATIC_BASE
was printed twice during the same block, the first for the cctor
and the second for the getter, as if they were two calls for the
same method.
* Removing helper CORINFO_HELP_STRCNS_CURRENT_MODULE
* Removing CORINFO_HELP_STRCNS_CURRENT_MODULE
* Changing TYP_BYREF to TYP_VOID
* Formatting files
* Splitting up R2R STATIC_BASE in more helpers
* Updating STATIC_BASE R2R helper with new helpers
* Extending getReadyToRunHelper support
Consider the new R2R helpers that were group in
CORINFO_HELP_READYTORUN_STATIC_BASE.
* Keeping the preffered R2R helper constructor
In some cases the R2R helpers already call to the
constructor. In those cases we can insert a repeated
call that will be eliminated by CSE. There are still
cases in which we may need to call the constructor.
* Extending value numbering with new helpers
* Renaming helper
* Replacing STATIC_BASE helper in ilc for NON_GC
* Fixing helper order
* Refactoring code
* Supporting R2R_STATIC_BASE helper in nativeaot
* Moving compiler var initialization to compCompile
* Using new helper names in ILC
* Encapsulating common method
* Removing CORINFO_HELP_READYTORUN_STATIC_BASE helper
* Removing comment
* Moving new helper function to shared code
* Setting undef helper as default
* Repeating same helper call for CSE optimization
Avoid hardcoding the Non-GC helper call, which is used just to
trigger the constructor if it is needed, and use the existing
helper call in the code, so CSE would persist only one.
* Update src/coreclr/jit/compiler.cpp
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
* Update src/coreclr/tools/Common/Compiler/DependencyAnalysis/CorInfoHelpers.cs
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
* Update src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Update src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Formatting jithelpers.h
* Renaming function
* Moving CorInfoHelper function to R2R/AOT interface
* Updating preferred helper when is not thread type
* Removing some helper value nums
Static base helper was removed and cctor returns
void.
* Formatting file
* Ensuring void return when the helper is cctor
* Updating preferred helper when when classes matches
* Removing cctor trigger helper from aot,vm and jit
* Updating m_prefferedInitCctor default value
It is initialized with CORINFO_HELP_UNDEF and set to R2R GC or NON
GC Static Base later.
* Updating comments
* Updating comments
Co-authored-by: Brian Bohe <brianbohe@microsoft.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>1 parent ba3ee73 commit c635ae2
16 files changed
Lines changed: 138 additions & 47 deletions
File tree
- src/coreclr
- inc
- jit
- tools
- Common/JitInterface
- aot
- ILCompiler.ReadyToRun/JitInterface
- ILCompiler.RyuJit/JitInterface
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
420 | 419 | | |
421 | 420 | | |
422 | 421 | | |
| |||
591 | 590 | | |
592 | 591 | | |
593 | 592 | | |
594 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
595 | 597 | | |
596 | 598 | | |
597 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1968 | 1968 | | |
1969 | 1969 | | |
1970 | 1970 | | |
| 1971 | + | |
| 1972 | + | |
1971 | 1973 | | |
1972 | 1974 | | |
1973 | 1975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4661 | 4661 | | |
4662 | 4662 | | |
4663 | 4663 | | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
4664 | 4670 | | |
4665 | 4671 | | |
4666 | 4672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3597 | 3597 | | |
3598 | 3598 | | |
3599 | 3599 | | |
3600 | | - | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
3601 | 3603 | | |
3602 | 3604 | | |
3603 | 3605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
885 | 885 | | |
886 | 886 | | |
887 | 887 | | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
888 | 901 | | |
889 | 902 | | |
890 | 903 | | |
| |||
893 | 906 | | |
894 | 907 | | |
895 | 908 | | |
896 | | - | |
897 | | - | |
| 909 | + | |
| 910 | + | |
898 | 911 | | |
899 | 912 | | |
900 | 913 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4277 | 4277 | | |
4278 | 4278 | | |
4279 | 4279 | | |
4280 | | - | |
| 4280 | + | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
4281 | 4287 | | |
4282 | 4288 | | |
4283 | 4289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8369 | 8369 | | |
8370 | 8370 | | |
8371 | 8371 | | |
8372 | | - | |
8373 | | - | |
8374 | | - | |
8375 | | - | |
8376 | | - | |
8377 | | - | |
8378 | | - | |
8379 | | - | |
8380 | | - | |
8381 | | - | |
8382 | | - | |
8383 | | - | |
| 8372 | + | |
| 8373 | + | |
| 8374 | + | |
8384 | 8375 | | |
8385 | 8376 | | |
8386 | 8377 | | |
| |||
14312 | 14303 | | |
14313 | 14304 | | |
14314 | 14305 | | |
14315 | | - | |
| 14306 | + | |
| 14307 | + | |
14316 | 14308 | | |
14317 | 14309 | | |
14318 | 14310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1399 | 1399 | | |
1400 | 1400 | | |
1401 | 1401 | | |
1402 | | - | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1403 | 1406 | | |
1404 | 1407 | | |
1405 | 1408 | | |
| |||
0 commit comments