[RFC] Add FIR->Affine(optimization)->FIR pass pipeline

Enabling all of these optimizations by default (removing the flag) is likely to be quite challenging. For example, I expect it will not be possible to do the lowering to OpenMP by default because (if I understand correctly) this could involve parallelizing loops which the programmer has not requested to be run in parallel. If the Fortran standard even allows that, it would put all of the correctness requirements on the compiler. I think it could be difficult to inspect a loop and determine at compile time if it is safe and profitable to parallelize without any assurance form the programmer.

However, contributing this upstream behind a flag is very welcome (at least from me). And hopefully some polyhedral optimizations could be safe to enable by default if they prove profitable.

1 Like