[all-commits] [llvm/llvm-project] a4dc61: [MLIR][SPIRVToLLVM] Implementation of spv.func con...

George Mitenkov via All-commits all-commits at lists.llvm.org
Tue Jun 23 08:34:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a4dc61344f08f7581b8794c5819ffdf9c708ecfe
      https://github.com/llvm/llvm-project/commit/a4dc61344f08f7581b8794c5819ffdf9c708ecfe
  Author: George Mitenkov <georgemitenk0v at gmail.com>
  Date:   2020-06-23 (Tue, 23 Jun 2020)

  Changed paths:
    M mlir/include/mlir/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.h
    M mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
    M mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVMPass.cpp
    A mlir/test/Conversion/SPIRVToLLVM/func-to-llvm.mlir

  Log Message:
  -----------
  [MLIR][SPIRVToLLVM] Implementation of spv.func conversion, and return ops

This patch provides an implementation for `spv.func` conversion. The pattern
is populated in a separate method added to the pass. At the moment, the type
signature conversion only includes the supported types. The conversion pattern
also matches SPIR-V function control attributes to LLVM function attributes.
Those are modelled as `passthrough` attributes in LLVM dialect. The following
mapping are used:
- None: no attributes passed
- Inline: `alwaysinline` seems to be the right equivalent (`inlinehint` is
  semantically weaker in my opinion)
- DontInline: `noinline`
- Pure and Const: I think those can be modelled as `readonly` and `readnone`
  attributes respectively.

Also, 2 patterns added for return ops conversion (`spv.Return` for void return
and `spv.ReturnValue` for a single value return).

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




More information about the All-commits mailing list