[all-commits] [llvm/llvm-project] 270a33: [mlir] Fix Python bindings tests failure in Debug ...

Vladislav Vinogradov via All-commits all-commits at lists.llvm.org
Thu Mar 18 22:33:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 270a336ff46204acf887def32c92ad695f767471
      https://github.com/llvm/llvm-project/commit/270a336ff46204acf887def32c92ad695f767471
  Author: Vladislav Vinogradov <vlad.vinogradov at intel.com>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M mlir/include/mlir/IR/BuiltinAttributes.td

  Log Message:
  -----------
  [mlir] Fix Python bindings tests failure in Debug mode after D98474

Add extra `type.isa<FloatType>()` check to  `FloatAttr::get(Type, double)` method.
Otherwise it tries to call `type.cast<FloatType>()`, which fails with assertion in Debug mode.

The `!type.isa<FloatType>()` case just redirercts the call to `FloatAttr::get(Type, APFloat)`,
which will perform the actual check and emit appropriate error.

Reviewed By: mehdi_amini

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




More information about the All-commits mailing list