[all-commits] [llvm/llvm-project] d64b3e: [mlir] Avoid needlessly converting LLVM named stru...

ftynse via All-commits all-commits at lists.llvm.org
Mon Dec 6 04:42:26 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d64b3e47ba6347ef4c68c0666a90eda8f986f525
      https://github.com/llvm/llvm-project/commit/d64b3e47ba6347ef4c68c0666a90eda8f986f525
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-12-06 (Mon, 06 Dec 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
    M mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
    M mlir/test/Conversion/StandardToLLVM/convert-types.mlir

  Log Message:
  -----------
  [mlir] Avoid needlessly converting LLVM named structs with compatible elements

Conversion of LLVM named structs leads to them being renamed since we cannot
modify the body of the struct type once it is set. Previously, this applied to
all named struct types, even if their element types were not affected by the
conversion. Make this behvaior only applicable when element types are changed.
This requires making the LLVM dialect type-compatibility check recursively look
at the element types (arguably, it should have been doing than since the moment
the LLVM dialect type system stopped being closed). In addition, have a more
lax check for outer types only to avoid repeated check when necessary (e.g.,
parser, verifiers that are going to also look at the inner type).

Reviewed By: wsmoses

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




More information about the All-commits mailing list