[all-commits] [llvm/llvm-project] 1ef32e: [mlir][Arithmetic] Fix printing larger integer att...

Marius Hillenbrand via All-commits all-commits at lists.llvm.org
Sun Jul 24 20:15:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1ef32e78284bc758112632e9e190b6683ea5b95b
      https://github.com/llvm/llvm-project/commit/1ef32e78284bc758112632e9e190b6683ea5b95b
  Author: Marius Hillenbrand <mhillen at linux.ibm.com>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
    M mlir/test/Dialect/Arithmetic/ops.mlir

  Log Message:
  -----------
  [mlir][Arithmetic] Fix printing larger integer attributes in arith.const

For arith.constant operations of integer type, the operation generates
result names that include the value of the constant (i.e., the
IntegerAttr that defines the constant's value). That code currently
assumes integer widths of 64 bits or less and hits an assert with wider
constants or would create truncated and potentially ambiguous names when
built with assertions disabled.

To enable printing arith.constant ops for arbitrarily wide integer
types, change to use the IntegerAttr's function getValue() when
generating result names.

Also, add a regression test.

Reviewed By: bondhugula

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




More information about the All-commits mailing list