[all-commits] [llvm/llvm-project] fd673e: [MLIR][SCF] Removes incorrect assertion in loop un...

Stephen Chou via All-commits all-commits at lists.llvm.org
Sun Oct 15 21:20:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd673e8c4e4fc5a892309fe201c8d238dd72c941
      https://github.com/llvm/llvm-project/commit/fd673e8c4e4fc5a892309fe201c8d238dd72c941
  Author: Stephen Chou <stephenchouca at users.noreply.github.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M mlir/lib/Dialect/SCF/Utils/Utils.cpp
    M mlir/test/Dialect/SCF/loop-unroll.mlir

  Log Message:
  -----------
  [MLIR][SCF] Removes incorrect assertion in loop unroller (#69028)

In particular, `upperBoundUnrolledCst` may be larger than `ubCst` when:

1. the step size is greater than 1;
2. `ub - lb` is not evenly divisible by the step size; and
3. the loop's trip count is evenly divisible by the unroll factor.

This is okay since the non-unit step size ensures that the unrolled loop
maintains the same trip count as the original loop. Added a test case
for this.

Fixes #61832.

Co-authored-by: Stephen Chou <stephenchou at google.com>




More information about the All-commits mailing list