[all-commits] [llvm/llvm-project] 7095a1: Fix endian conversion of sub-byte types

Ulrich Weigand via All-commits all-commits at lists.llvm.org
Sun Jun 12 07:08:51 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7095a1ff82b9fe292f871f0e873c2ac56328e8a6
      https://github.com/llvm/llvm-project/commit/7095a1ff82b9fe292f871f0e873c2ac56328e8a6
  Author: Ulrich Weigand <ulrich.weigand at de.ibm.com>
  Date:   2022-06-12 (Sun, 12 Jun 2022)

  Changed paths:
    M mlir/lib/IR/BuiltinAttributes.cpp
    A mlir/test/IR/parse-literal.mlir

  Log Message:
  -----------
  Fix endian conversion of sub-byte types

When convertEndianOfCharForBEmachine is called with elementBitWidth
smaller than CHAR_BIT, the default case is invoked, but this does
nothing at all and leaves the output array unchanged.

Fix DenseIntOrFPElementsAttr::convertEndianOfArrayRefForBEmachine
by not calling convertEndianOfCharForBEmachine in this case, and
instead simply copying the input to the output (for sub-byte types,
endian conversion is in fact a no-op).

Reviewed By: rriddle

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




More information about the All-commits mailing list