Uh oh!
There was an error while loading. Please reload this page.
Fold constant string null checks - #1377
Closed
mikedn wants to merge 1 commit into
Closed
Conversation
ContributorAuthor
Example from #1368 G_M26703_IG01:56pushrsi 4883EC20 subrsp,32 ;; bbWeight=1 PerfScore 1.25G_M26703_IG02: 48B898314E43CE010000 movrax,0x1CE434E319848833800cmp gword ptr [rax],0 740E je SHORT G_M26703_IG06 ;; bbWeight=1 PerfScore 3.25G_M26703_IG03: 4885C9 testrcx,rcx7442je SHORT G_M26703_IG07 ;; bbWeight=0.50 PerfScore 0.63G_M26703_IG04: 488BC1 movrax,rcx ;; bbWeight=1 PerfScore 0.25G_M26703_IG05: 4883C420 addrsp,32 5E poprsi C3 ret ;; bbWeight=1 PerfScore 1.75G_M26703_IG06: 48B9C8B9D1A3FA7F0000 movrcx,0x7FFAA3D1B9C8 E81E178B5F call CORINFO_HELP_NEWSFAST…After: G_M26703_IG01:56pushrsi 4883EC20 subrsp,32 ;; bbWeight=1 PerfScore 1.25G_M26703_IG02: 4885C9 testrcx,rcx7409je SHORT G_M26703_IG05 ;; bbWeight=1 PerfScore 1.25G_M26703_IG03: 488BC1 movrax,rcx ;; bbWeight=1 PerfScore 0.25G_M26703_IG04: 4883C420 addrsp,32 5E poprsi C3 ret ;; bbWeight=1 PerfScore 1.75G_M26703_IG05: 48B9C8B9D2A3FA7F0000 movrcx,0x7FFAA3D2B9C8 E82E178A5F call CORINFO_HELP_NEWSFAST… |
mikedn
commented
Jan 7, 2020
ContributorAuthor
Diff summary: The |
EgorBo
commented
Jan 8, 2020
Member
Heh, this PR along with #1378 should eliminate |
EgorBo
commented
Apr 14, 2020
Member
@mikedn May I ask why you closed this? ReadOnlySpan<char>span="hello";currently produces a redundant nullcheck over ldstr. |
drieseng
commented
Apr 18, 2020
Contributor
EgorBo
commented
Apr 18, 2020
Member
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
Sign up for freeto 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.
GT_CNS_STRcan't ever produce a null value so we can constant fold"str" != nulland similar expressions early, beforeGT_CNS_STRgets expanded into anIND(GT_CNS_INT)which is more problematic to recognize as non null.Fixes#1368