We noticed that transformations that operate on func::FuncOp, e.g., AffineScalarReplacementPass, don't get invoked for func::FuncOp nested inside another region, e.g., gpu.module.
This commit allows transformations that operate on func::FuncOp to work as expected even if the func::FuncOp operation is nested in another region.
I'm not sure I understand what you're trying to do.
If you want -affine-scalrep to be scheduled on the function, you should do so explicitly.
mlir-opt --pass-pipeline="gpu.module(func.func(affine-scalrep))"