[all-commits] [llvm/llvm-project] 18d0f7: [mlir] add canonicalization patterns for trivial S...

ftynse via All-commits all-commits at lists.llvm.org
Fri Nov 20 10:05:01 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 18d0f7d5c3b0f8fae2cb6cd5db3977df26e3533f
      https://github.com/llvm/llvm-project/commit/18d0f7d5c3b0f8fae2cb6cd5db3977df26e3533f
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-11-20 (Fri, 20 Nov 2020)

  Changed paths:
    M mlir/lib/Dialect/SCF/SCF.cpp
    M mlir/test/Dialect/SCF/canonicalize.mlir

  Log Message:
  -----------
  [mlir] add canonicalization patterns for trivial SCF 'for' and 'if'

Add canoncalization patterns to remove zero-iteration 'for' loops, replace
single-iteration 'for' loops with their bodies; remove known-false conditionals
with no 'else' branch and replace conditionals with known value by the
respective region. Although similar transformations are performed at the CFG
level, not all flows reach that level, e.g., the GPU flow may want to remove
single-iteration loops before deciding on loop mapping to thread dimensions.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D91865




More information about the All-commits mailing list