This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Undo more JIT layout workarounds #13961
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove some `goto`s that were added to work around undesirable jit layout (#9692, fixed in dotnet#13314) and epilog factoring (improved in dotnet#13792 and dotnet#13903), which are no longer needed. Resolves #13466.
Author
|
@stephentoub / @jkotas PTAL. The machine code generated by crossgen of SPCLib is identical before/after this change for diff --git "a/.\\StartsWithOrdinalHelper-before.dasm" "b/.\\StartsWithOrdinalHelper-after.dasm"
index c8c3551..b38eb8b 100644
--- "a/.\\StartsWithOrdinalHelper-before.dasm"
+++ "b/.\\StartsWithOrdinalHelper-after.dasm"
@@ -12,9 +12,10 @@
; V04 loc2 [V04 ] ( 2, 2 ) byref -> [rsp+0x08] must-init pinned
; V05 loc3 [V05,T00] ( 13, 35.50) long -> rdx
; V06 loc4 [V06,T01] ( 13, 35.50) long -> rcx
-; V07 tmp0 [V07,T05] ( 2, 4 ) long -> rdx
-; V08 tmp1 [V08,T06] ( 2, 4 ) long -> rcx
-;# V09 OutArgs [V09 ] ( 1, 1 ) lclBlk ( 0) [rsp+0x00]
+; V07 tmp0 [V07,T05] ( 2, 2 ) int -> rax
+; V08 tmp1 [V08,T06] ( 2, 4 ) long -> rdx
+; V09 tmp2 [V09,T07] ( 2, 4 ) long -> rcx
+;# V10 OutArgs [V10 ] ( 1, 1 ) lclBlk ( 0) [rsp+0x00]
;
; Lcl frame size = 24
@@ -35,37 +36,47 @@ G_M6815_IG02:
488B4C2408 mov rcx, bword ptr [rsp+08H]
448B02 mov r8d, dword ptr [rdx]
443B01 cmp r8d, dword ptr [rcx]
- 7574 jne SHORT G_M6815_IG08
+ 7577 jne SHORT G_M6815_IG14
+
+G_M6815_IG02B:
83C0FE add eax, -2
4883C204 add rdx, 4
4883C104 add rcx, 4
83F80C cmp eax, 12
- 7C2C jl SHORT G_M6815_IG04
+ 7C2C jl SHORT G_M6815_IG08
-G_M6815_IG03:
+G_M6815_IG04:
4C8B02 mov r8, qword ptr [rdx]
4C3B01 cmp r8, qword ptr [rcx]
- 755C jne SHORT G_M6815_IG08
+ 755F jne SHORT G_M6815_IG14
+
+G_M6815_IG03B:
4C8B4208 mov r8, qword ptr [rdx+8]
4C3B4108 cmp r8, qword ptr [rcx+8]
- 7552 jne SHORT G_M6815_IG08
+ 7555 jne SHORT G_M6815_IG14
+
+G_M6815_IG03C:
4C8B4210 mov r8, qword ptr [rdx+16]
4C3B4110 cmp r8, qword ptr [rcx+16]
- 7548 jne SHORT G_M6815_IG08
+ 754B jne SHORT G_M6815_IG14
+
+G_M6815_IG03D:
83C0F4 add eax, -12
4883C218 add rdx, 24
4883C118 add rcx, 24
83F80C cmp eax, 12
- 7DD4 jge SHORT G_M6815_IG03
+ 7DD4 jge SHORT G_M6815_IG04
-G_M6815_IG04:
+G_M6815_IG08:
83F802 cmp eax, 2
- 7C18 jl SHORT G_M6815_IG06
+ 7C18 jl SHORT G_M6815_IG11
G_M6815_IG05:
448B02 mov r8d, dword ptr [rdx]
443B01 cmp r8d, dword ptr [rcx]
- 752B jne SHORT G_M6815_IG08
+ 752E jne SHORT G_M6815_IG08
+
+G_M6815_IG05B:
83C0FE add eax, -2
4883C204 add rdx, 4
4883C104 add rcx, 4
@@ -83,6 +94,9 @@ G_M6815_IG06:
0BC2 or eax, edx
G_M6815_IG07:
+ 0FB6C0 movzx rax, al ; <-- this is new
+
+G_M6815_IG07B:
4883C418 add rsp, 24
C3 ret
@@ -93,7 +107,7 @@ G_M6815_IG09:
4883C418 add rsp, 24
C3 ret
-; Total bytes of code 180, prolog size 16 for method String:StartsWithOrdinalHelper(ref,ref):bool
+; Total bytes of code 183, prolog size 16 for method String:StartsWithOrdinalHelper(ref,ref):bool |
jkotas
approved these changes
Sep 13, 2017
Member
jkotas
left a comment
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.
Thanks!
stephentoub
approved these changes
Sep 13, 2017
Member
stephentoub
left a comment
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.
Thanks, @JosephTremoulet.
Author
|
@dotnet-bot test Windows_NT arm Cross Checked Build and Test (a known issue was just resolved) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove some
gotos that were added to work around undesirable jitlayout (#9692, fixed in #13314) and epilog factoring (improved in
#13792 and #13903), which are no longer needed.
Resolves #13466.