Skip to content
Commit bab53a94 authored by Nicolas Vasilache's avatar Nicolas Vasilache Committed by Mehdi Amini
Browse files

Add a Linalg fusion pass.

This CL adds a fusion pass for the Linalg dialect.
Fusion is backed by a simple analysis on SSA values and proceeds as follows:
1. A dependence and alias analyses are performed on views.
2. A Linalg op is tiled by a particular tile size. This creates a new Linalg op operating on tiled loops and tiled views.
3. The dependence analysis is used to obtain ops that produce views that are consumed by the original Linalg op.
4. Dependence analysis is used to determine whether op-level fusion would violate any dependence.
5. If fusion is safe, matching tiled views are sliced for the producing op.
6. A tiled clone of the producer op is written before the tiled consumer op.

If a producer is fused, its entire output view has been computed in tiled form.
The original producer op is then erased.

PiperOrigin-RevId: 252695194
parent a8a4d35d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment