[Mlir-commits] [mlir] [MLIR][SCF] fix loop pipelining pass use of uninitialized value (PR #146991)

Thomas Raoux llvmlistbot at llvm.org
Fri Jul 4 18:24:19 PDT 2025


ThomasRaoux wrote:

> The two failed cases in `Dialect/SCF/transform-ops.mlir` are both corner cases that `numIteration == maxStage`. In those cases, loops are able to properly pipelined, with a pipeline kernel that iterates for zero time, looks like:
> 
> ```
> S0(0)                        
> S0(1) S1(0)                  
> scf.for ... to ... {            <-- which will iterates for zero time
>   S0(I+2) S1(I+1) S2(I)      
> }
> S1(N) S2(N-1)                
> S2(N)                        
> ```
> 
> Test `Dialect/SCF/transform-ops.mlir` itself is correct. I have updated the checking condition from `numIteration > maxStage` to `numIteration >= maxStage` in code. @ThomasRaoux could you have a review on that?
> 
> ```
> ********************
> Failed Tests (2):
>   MLIR-Unit :: Target/LLVM/./MLIRTargetLLVMTests/MLIRTargetLLVMROCDL/GetELFMetadata
>   MLIR-Unit :: Target/LLVM/./MLIRTargetLLVMTests/MLIRTargetLLVMROCDL/SerializeROCDLToBinary
> 
> 
> Testing Time: 12.77s
> 
> Total Discovered Tests: 3332
>   Skipped          :    1 (0.03%)
>   Unsupported      :  458 (13.75%)
>   Passed           : 2870 (86.13%)
>   Expectedly Failed:    1 (0.03%)
>   Failed           :    2 (0.06%)
> ```

makes sense. Could you add a lit test for the case it changes (when we detect dynamicLoop=false)

https://github.com/llvm/llvm-project/pull/146991


More information about the Mlir-commits mailing list