[all-commits] [llvm/llvm-project] 9a0ea5: [mlir] Support alignment in LLVM dialect GlobalOp

ftynse via All-commits all-commits at lists.llvm.org
Wed May 12 00:07:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a0ea5994bdc477d77fd4d9f4eb5d34b1ac4184a
      https://github.com/llvm/llvm-project/commit/9a0ea5994bdc477d77fd4d9f4eb5d34b1ac4184a
  Author: Dumitru Potop <dumitru.potop at inria.fr>
  Date:   2021-05-12 (Wed, 12 May 2021)

  Changed paths:
    M mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
    M mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/test/Dialect/LLVMIR/global.mlir
    M mlir/test/Dialect/LLVMIR/invalid.mlir
    M mlir/test/Target/LLVMIR/import.ll
    M mlir/test/Target/LLVMIR/llvmir.mlir

  Log Message:
  -----------
  [mlir] Support alignment in LLVM dialect GlobalOp

First step in adding alignment as an attribute to MLIR global definitions. Alignment can be specified for global objects in LLVM IR. It can also be specified as a named attribute in the LLVMIR dialect of MLIR. However, this attribute has no standing and is discarded during translation from MLIR to LLVM IR. This patch does two things: First, it adds the attribute to the syntax of the llvm.mlir.global operation, and by doing this it also adds accessors and verifications. The syntax is "align=XX" (with XX being an integer), placed right after the value of the operation. Second, it allows transforming this operation to and from LLVM IR. It is checked whether the value is an integer power of 2.

Reviewed By: ftynse, mehdi_amini

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




More information about the All-commits mailing list