[all-commits] [llvm/llvm-project] 6bfb41: set the alignment of mlir::AttributeStorage to 64 ...

daquexian via All-commits all-commits at lists.llvm.org
Tue Nov 17 17:52:14 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bfb4120ead7d7503f079960d7f98eacdf0be03a
      https://github.com/llvm/llvm-project/commit/6bfb4120ead7d7503f079960d7f98eacdf0be03a
  Author: daquexian <daquexian566 at gmail.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M mlir/include/mlir/IR/AttributeSupport.h
    M mlir/include/mlir/IR/Attributes.h
    M mlir/lib/IR/AttributeDetail.h

  Log Message:
  -----------
  set the alignment of mlir::AttributeStorage to 64 bit explicitly to fix 32 bit platform

On some platform (like WebAssembly), alignof(mlir::AttributeStorage) is 4 instead of 8. As a result, it makes the program crashes since PointerLikeTypeTraits<mlir::Attribute>::NumLowBitsAvailable is 3.

So I explicitly set the alignment of mlir::AttributeStoarge to 64 bits, and set PointerLikeTypeTraits<mlir::Attribute>::NumLowBitsAvailable according to it.

I also fixed an another related error (alignof(NamedAttribute) -> alignof(DictionaryAttributeStorage)) based on reviewer's comments.

Reviewed By: dblaikie, rriddle

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




More information about the All-commits mailing list