Skip to content

JIT: Remove DIV(NEG(a), C) => DIV(a, NEG(C)) opt - #60312

Merged
EgorBo merged 2 commits into
dotnet:mainfrom
EgorBo:jit-remove-div-cns-opt
Oct 13, 2021
Merged

EgorBo merged 2 commits into
dotnet:mainfrom
EgorBo:jit-remove-div-cns-opt

Conversation

@EgorBo

@EgorBo EgorBo commented Oct 12, 2021

Copy link
Copy Markdown
Member

Fixes #60297

It removes "-X / CNS => X / -CNS" optimization as it's not ECMA friendly around int.MinValue for X, see #60297 (comment)

aspnet.run.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 11960181 (overridden on cmd)
Total bytes of diff: 11960183 (overridden on cmd)
Total bytes of delta: 2 (0.00 % of base)
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           2 : 9985.dasm (0.22% of base)

1 total files with Code Size differences (0 improved, 1 regressed), 5 unchanged.

Top method regressions (bytes):
           2 ( 0.22% of base) : 9985.dasm - PathHelper:Normalize(String):String

Top method regressions (percentages):
           2 ( 0.22% of base) : 9985.dasm - PathHelper:Normalize(String):String

1 total methods with Code Size differences (0 improved, 1 regressed), 5 unchanged.


coreclr_tests.pmi.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 124779987 (overridden on cmd)
Total bytes of diff: 124780003 (overridden on cmd)
Total bytes of delta: 16 (0.00 % of base)
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           6 : 249866.dasm (19.35% of base)
           6 : 249868.dasm (30.00% of base)
           4 : 249865.dasm (21.05% of base)

3 total files with Code Size differences (0 improved, 3 regressed), 2 unchanged.

Top method regressions (bytes):
           6 (19.35% of base) : 249866.dasm - TestIntLimits.Program:LongDivNeg1000(long):long
           6 (30.00% of base) : 249868.dasm - TestIntLimits.Program:LongDivNegLongMinValue(long):long
           4 (21.05% of base) : 249865.dasm - TestIntLimits.Program:DivNeg11(int):int

Top method regressions (percentages):
           6 (30.00% of base) : 249868.dasm - TestIntLimits.Program:LongDivNegLongMinValue(long):long
           4 (21.05% of base) : 249865.dasm - TestIntLimits.Program:DivNeg11(int):int
           6 (19.35% of base) : 249866.dasm - TestIntLimits.Program:LongDivNeg1000(long):long

3 total methods with Code Size differences (0 improved, 3 regressed), 2 unchanged.


libraries.crossgen2.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 34847973 (overridden on cmd)
Total bytes of diff: 34847975 (overridden on cmd)
Total bytes of delta: 2 (0.00 % of base)
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           2 : 96539.dasm (11.11% of base)

1 total files with Code Size differences (0 improved, 1 regressed), 0 unchanged.

Top method regressions (bytes):
           2 (11.11% of base) : 96539.dasm - System.SpanHelpers:UnalignedCountVector128(byref):long

Top method regressions (percentages):
           2 (11.11% of base) : 96539.dasm - System.SpanHelpers:UnalignedCountVector128(byref):long

1 total methods with Code Size differences (0 improved, 1 regressed), 0 unchanged.


@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 12, 2021
@ghost

ghost commented Oct 12, 2021

Copy link
Copy Markdown

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

Issue Details

Fixes #60297

It removes "-X / CNS => X / -CNS" optimization as it's not ECMA friendly around int.MinValue for X, see #60297 (comment)

aspnet.run.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 11960181 (overridden on cmd)
Total bytes of diff: 11960183 (overridden on cmd)
Total bytes of delta: 2 (0.00 % of base)
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           2 : 9985.dasm (0.22% of base)

1 total files with Code Size differences (0 improved, 1 regressed), 5 unchanged.

Top method regressions (bytes):
           2 ( 0.22% of base) : 9985.dasm - PathHelper:Normalize(String):String

Top method regressions (percentages):
           2 ( 0.22% of base) : 9985.dasm - PathHelper:Normalize(String):String

1 total methods with Code Size differences (0 improved, 1 regressed), 5 unchanged.


coreclr_tests.pmi.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 124779987 (overridden on cmd)
Total bytes of diff: 124780003 (overridden on cmd)
Total bytes of delta: 16 (0.00 % of base)
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           6 : 249866.dasm (19.35% of base)
           6 : 249868.dasm (30.00% of base)
           4 : 249865.dasm (21.05% of base)

3 total files with Code Size differences (0 improved, 3 regressed), 2 unchanged.

Top method regressions (bytes):
           6 (19.35% of base) : 249866.dasm - TestIntLimits.Program:LongDivNeg1000(long):long
           6 (30.00% of base) : 249868.dasm - TestIntLimits.Program:LongDivNegLongMinValue(long):long
           4 (21.05% of base) : 249865.dasm - TestIntLimits.Program:DivNeg11(int):int

Top method regressions (percentages):
           6 (30.00% of base) : 249868.dasm - TestIntLimits.Program:LongDivNegLongMinValue(long):long
           4 (21.05% of base) : 249865.dasm - TestIntLimits.Program:DivNeg11(int):int
           6 (19.35% of base) : 249866.dasm - TestIntLimits.Program:LongDivNeg1000(long):long

3 total methods with Code Size differences (0 improved, 3 regressed), 2 unchanged.


libraries.crossgen2.windows.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 34847973 (overridden on cmd)
Total bytes of diff: 34847975 (overridden on cmd)
Total bytes of delta: 2 (0.00 % of base)
    diff is a regression.
    relative diff is a regression.
Detail diffs


Top file regressions (bytes):
           2 : 96539.dasm (11.11% of base)

1 total files with Code Size differences (0 improved, 1 regressed), 0 unchanged.

Top method regressions (bytes):
           2 (11.11% of base) : 96539.dasm - System.SpanHelpers:UnalignedCountVector128(byref):long

Top method regressions (percentages):
           2 (11.11% of base) : 96539.dasm - System.SpanHelpers:UnalignedCountVector128(byref):long

1 total methods with Code Size differences (0 improved, 1 regressed), 0 unchanged.


Author: EgorBo
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo EgorBo changed the title Jit remove div cns opt JIT: Remove DIV(NEG(a), C) => DIV(a, NEG(C)) opt Oct 12, 2021
@EgorBo EgorBo closed this Oct 13, 2021
@EgorBo EgorBo reopened this Oct 13, 2021
@EgorBo
EgorBo merged commit 51d43eb into dotnet:main Oct 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RyuJIT: Invalidly optimized negated division

3 participants