[all-commits] [llvm/llvm-project] 856056: [mlir][LLVMIR] Add support for va_start/copy/end i...

Min-Yih Hsu via All-commits all-commits at lists.llvm.org
Mon Jun 27 09:49:04 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 856056d1b0b34be3f72848dd28b32a800f551ad5
      https://github.com/llvm/llvm-project/commit/856056d1b0b34be3f72848dd28b32a800f551ad5
  Author: Min-Yih Hsu <minyihh at uci.edu>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M mlir/docs/TargetLLVMIR.md
    M mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
    M mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/test/Conversion/FuncToLLVM/convert-funcs.mlir
    M mlir/test/Dialect/LLVMIR/func.mlir
    M mlir/test/Dialect/LLVMIR/roundtrip.mlir
    M mlir/test/Target/LLVMIR/Import/basic.ll
    M mlir/test/Target/LLVMIR/Import/intrinsic.ll
    M mlir/test/Target/LLVMIR/llvmir.mlir
    M mlir/test/mlir-cpu-runner/lit.local.cfg
    A mlir/test/mlir-cpu-runner/x86-varargs.mlir

  Log Message:
  -----------
  [mlir][LLVMIR] Add support for va_start/copy/end intrinsics

This patch adds three new LLVM intrinsic operations: llvm.intr.vastart/copy/end.
And its translation from LLVM IR.

This effectively removes a restriction, imposed by 0126dcf1f0a1, where
non-external functions in LLVM dialect cannot be variadic. At that time
it was not clear how LLVM intrinsics are going to be modeled, which
indirectly affects va_start/copy/end, the core intrinsics used in
variadic functions. But since we have LLVM intrinsics as normal
MLIR operations, it's not a problem anymore.

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


  Commit: fc7f7260a609b2092260b6a5e867a20cf364808c
      https://github.com/llvm/llvm-project/commit/fc7f7260a609b2092260b6a5e867a20cf364808c
  Author: Min-Yih Hsu <minyihh at uci.edu>
  Date:   2022-06-27 (Mon, 27 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp

  Log Message:
  -----------
  [mlir][LLVMIR] Memorize compatible LLVM types

This patch memorize compatible LLVM types in `LLVM::isCompatibleType` in
order to avoid redundant works.

This is especially useful when the size of program is big and there are
multiple occurrences of some deeply nested LLVM struct types, in which
case we can gain quite some speedups with this patch.

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


Compare: https://github.com/llvm/llvm-project/compare/3a1a404ae2d3...fc7f7260a609


More information about the All-commits mailing list