Skip to content

affine-loop-fusion does not respect fusion-compute-tolerance #54541

@aqjune

Description

@aqjune

Hello all,

It seems -affine-loop-fusion does not respect its fusion-compute-tolerance option, sometimes causing a big increase in running time.

I attach the source file (a.mlir - a.zip) and its output (a_out.zip).
I ran:

bin/mlir-opt '-affine-loop-fusion=mode=producer fusion-compute-tolerance=0.0' a.mlir -o a_out.mlir

a.mlir contains three loops that look as follows:

affine.for %i = 0 to 131072 {
    ... // A
}
affine.for %j = 0 to 30 {
    affine.for %i = 0 to 131072 {
        ... // B
    }
}

affine-loop-fusion fuses the loops as follows:

affine.for %j = 0 to 30 {
    affine.for %i = 0 to 131072 {
        ... // A <- this iterates 29 times more than before!
        ... // B
    }
}

Any idea about how to fully disable this fusion?

Thanks in advance,

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions