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

Huffman Benchmark has opportunities to fold addressing modes #6858

Open
sivarv opened this issue Oct 20, 2016 · 1 comment
Open

Huffman Benchmark has opportunities to fold addressing modes #6858

sivarv opened this issue Oct 20, 2016 · 1 comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Milestone

Comments

@sivarv
Copy link
Member

sivarv commented Oct 20, 2016

Huffman benchmark uses an array of structs

For e.g. the innermost triply nested while loop

while(hufftree[i].left!=-1)
{
    if(GetCompBit(comparray,bitoffset)==0)
        i=hufftree[i].left;
    else
       i=hufftree[i].right;
    bitoffset++;
}

CSE recognizes bounds checked &hufftree[i] as CSE candidate and replaces with a LclVar.

bounds check on hufftree[i]
tmp = LEA(&hufftree[i])

Now field accesses will turn into [reg+fieldoffset]. If we could fold tmp into field access, it will turn into
[huffTree + indexReg*scale + (16+fieldoffset)]. This avoids the need for a reg to tmp. In fact, for tmp there were no callee saved regs available and its gets spilled and reloaded across the call.

There are many such opportunities in Huffman benchmark to fold addr modes as it heavily accesses array of structs.

category:cq
theme:addressing-modes
skill-level:intermediate
cost:medium

@russellhadley
Copy link
Contributor

@sivarv can we look at MusicStore or Techempower to see if we have the same problem there? It would help prioritize this if we knew this hit in those workloads.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@BruceForstall BruceForstall added the JitUntriaged CLR JIT issues needing additional triage label Oct 28, 2020
@BruceForstall BruceForstall removed the JitUntriaged CLR JIT issues needing additional triage label Dec 5, 2020
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 enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

4 participants