[all-commits] [llvm/llvm-project] 892bf0: [mlir][arith] Allow to specify `constFoldBinaryOp`...

Jakub Kuderski via All-commits all-commits at lists.llvm.org
Mon Feb 13 11:20:11 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 892bf09606b654321c475b503210f30600c3ff7f
      https://github.com/llvm/llvm-project/commit/892bf09606b654321c475b503210f30600c3ff7f
  Author: Jakub Kuderski <kubak at google.com>
  Date:   2023-02-13 (Mon, 13 Feb 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/CommonFolders.h
    M mlir/lib/Dialect/Arith/IR/ArithOps.cpp
    M mlir/test/Dialect/Arith/canonicalize.mlir
    M mlir/test/Dialect/SCF/canonicalize.mlir

  Log Message:
  -----------
  [mlir][arith] Allow to specify `constFoldBinaryOp` result type

This enables us to use the common fold helpers on elementwise ops that
produce different result type than operand types, e.g., `arith.cmpi` or
`arith.addui_extended`.

Use the updated helper to teach `arith.cmpi` to fold constant vectors.

Reviewed By: Mogball

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




More information about the All-commits mailing list