[all-commits] [llvm/llvm-project] 140229: [MLIR] Simplify semi-affine expressions using flat...

Arnab Dutta via All-commits all-commits at lists.llvm.org
Tue Nov 16 02:13:02 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1402299271c1d57784f77dd577949e4a546a4c10
      https://github.com/llvm/llvm-project/commit/1402299271c1d57784f77dd577949e4a546a4c10
  Author: Arnab Dutta <arnab.dutta at cerebras.net>
  Date:   2021-11-16 (Tue, 16 Nov 2021)

  Changed paths:
    M mlir/include/mlir/IR/AffineExpr.h
    M mlir/include/mlir/IR/AffineExprVisitor.h
    M mlir/lib/IR/AffineExpr.cpp
    M mlir/test/Dialect/Affine/simplify-affine-structures.mlir
    M mlir/test/Dialect/SCF/for-loop-peeling.mlir

  Log Message:
  -----------
  [MLIR] Simplify semi-affine expressions using flattening

For the semi affine expressions, whenever rhs of a floordiv, ceildiv, mod
or product expression is a symbolic expression, we introduce a local variable
representing the result, and store the floordiv/ceildiv, mod or product
affine expression in LocalExprs. In this way the expression is flattened,
and trivial addition and subtraction related simplifications are performed.
Also rule based matching for detecting and transforming "expr - q * (expr floordiv q)"
to "expr mod q", where q is a symbolic exxpression, in simplifyAdd function.

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




More information about the All-commits mailing list