[all-commits] [llvm/llvm-project] 4bcc41: [MLIR][TableGen] Error on APInt parameter without ...

Robert Konicar via All-commits all-commits at lists.llvm.org
Tue Apr 22 02:01:28 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4bcc414af3782c333f3d535c0e0a92e6120868f5
      https://github.com/llvm/llvm-project/commit/4bcc414af3782c333f3d535c0e0a92e6120868f5
  Author: Robert Konicar <rkonicar at mail.muni.cz>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/SMT/IR/SMTAttributes.td
    M mlir/include/mlir/IR/BuiltinAttributes.td
    M mlir/include/mlir/TableGen/AttrOrTypeDef.h
    M mlir/lib/Dialect/SMT/IR/SMTAttributes.cpp
    M mlir/lib/TableGen/AttrOrTypeDef.cpp
    A mlir/test/mlir-tblgen/apint-param-error.td
    M mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp

  Log Message:
  -----------
  [MLIR][TableGen] Error on APInt parameter without custom comparator (#135970)

The error is triggered when an attribute or type uses an APInt typed
parameter with the generated equality operator. If the compared APInts
have different bit widths the equality operator triggers an assert. This
is dangerous, since `StorageUniquer` for types and attributes uses the
equality operator when a hash collision appears. As such, it is
necessary to use custom provided comarator or `APIntParameter` that
already has it.
This commit also replaces uses of the raw `APInt` parameter with the
`APIntParameter` and removes the no longer necessary custom StorageClass
for the `BitVectorAttr` from the SMT dialect that was a workaround for
the described issue.

---------

Co-authored-by: Tobias Gysi <tobias.gysi at nextsilicon.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list