Skip to content

JIT: Loops should have a canonical backedge #107189

Description

@jakobbotsch

As part of loop canonicalization we can canonicalize backedges such that the backedge is unique and always jumps to the loop header. This gives a place in the loop to insert IR we only want inserted when we know we are going for another iteration of the loop. As an example this is the only reliable way to guarantee that strength reduction can create IR to compute an IV it wants to create and use at all potential points within the loop.

https://github.com/jakobbotsch/runtime/pull/new/canonicalize-backedges has an implementation of this, but it has large regressions. It seems it can break loop cloning/unrolling and probably other optimizations, so we'll need to generalize them first.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions