Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop cloning: generalize recognized loop iteration patterns #60188

Open
BruceForstall opened this issue Oct 8, 2021 · 1 comment
Open

Loop cloning: generalize recognized loop iteration patterns #60188

BruceForstall opened this issue Oct 8, 2021 · 1 comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@BruceForstall
Copy link
Member

BruceForstall commented Oct 8, 2021

Currently, loop cloning only recognizes simple "count up" loops, e.g.,

for (i = c; i < x; i++)

The condition can be < or <=. x can be constant or a loop-invariant variable. c must be non-negative.

Consider handling additional patterns, such as "count down" loops (e.g., for (i = a.Length - 1; i >=0; i--)), or "nuint" cases (e.g., for (nuint i = (nuint)(arrLen - 1); i != nuint.MaxValue; i--)), and more.

One place this was suggested: #60148 (comment)

category:cq
theme:loop-opt
skill-level:expert
cost:medium
impact:medium

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

ghost commented Oct 8, 2021

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

Issue Details

Currently, loop cloning only recognizes simple "count up" loops, e.g.,

for (i = c; i < x; i++)

The condition can be < or <=. x can be constant or a loop-invariant variable. c must be non-negative.

Consider handling additional patterns, such as "count down" loops (e.g., for (i = a.Length - 1; i >=0; i--)), or "nuint" cases (e.g., for (nuint i = (nuint)(arrLen - 1); i != nuint.MaxValue; i--)), and more.

One place this was suggested: #60148 (comment)

category:cq
theme:loop-opt
skill-level:expert
cost:medium

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Oct 8, 2021
@BruceForstall BruceForstall added this to the Future milestone Oct 8, 2021
@BruceForstall BruceForstall removed the untriaged New issue has not been triaged by the area owner label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

1 participant