Skip to content

Loop unrolling support in RyuJIT #4248

@AndreyAkinshin

Description

@AndreyAkinshin

LegacyJIT-x64 can unroll some loops and transform something like

for (int i = 0; i < 1024; i++)
    Foo(i);

to something like

for (int i = 0; i < 1024; i += 4)
{
    Foo(i);
    Foo(i + 1);
    Foo(i + 2);
    Foo(i + 3);
}

Also LegacyJIT-x64 can transform small loops like

for (int i = 0; i < 4; i++)
    Foo(i);

to

Foo(0);
Foo(1);
Foo(2);
Foo(3);

I like this feature because it can increase performance in some cases.

Is it possible to implement loop unrolling in RyuJIT?

See also:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions