aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorSJW <48454132+sjw36@users.noreply.github.com>2024-10-15 15:13:49 -0500
committerGitHub <noreply@github.com>2024-10-15 13:13:49 -0700
commit8da5aa16f65bc297663573bacd3030f975b9fcde (patch)
tree849edd76ce15357d8d42d91f970fb21f1b84c3b9 /clang/lib/CodeGen/CodeGenFunction.cpp
parentde7f7ea884525cca24e8797319452bd8bc150752 (diff)
downloadllvm-8da5aa16f65bc297663573bacd3030f975b9fcde.zip
llvm-8da5aa16f65bc297663573bacd3030f975b9fcde.tar.gz
llvm-8da5aa16f65bc297663573bacd3030f975b9fcde.tar.bz2
[mlir][SCF] Fix dynamic loop pipeline peeling for num_stages > total_iters (#112418)
When pipelining an `scf.for` with dynamic loop bounds, the epilogue ramp-down must align with the prologue when num_stages > total_iterations. For example: ``` scf.for (0..ub) { load(i) add(i) store(i) } ``` When num_stages=3 the pipeline follows: ``` load(0) - add(0) - scf.for (0..ub-2) - store(ub-2) load(1) - - add(ub-1) - store(ub-1) ``` The trailing `store(ub-2)`, `i=ub-2`, must align with the ramp-up for `i=0` when `ub < num_stages-1`, so the index `i` should be `max(0, ub-2)` and each subsequent index is an increment. The predicate must also handle this scenario, so it becomes `predicate[0] = total_iterations > epilogue_stage`.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions