llvm-project/mlir/test/Target/LLVMIR/Import/function_attributes.ll
Slava Zakharin 13cb085ca1 [mlir] Support llvm.readnone attribute for all FunctionOpInterface ops.
The attribute is translated into LLVM's function attribute 'readnone'.
There is no explicit verification regarding conflicting 'readnone'
and function attributes from 'passthrough', though, LLVM would assert
if they are incompatible during LLVM IR creation.

Differential Revision: https://reviews.llvm.org/D131457
2022-08-24 10:12:37 -07:00

18 lines
377 B
LLVM

; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s
// -----
; CHECK: llvm.func @readnone_attr() attributes {llvm.readnone}
declare void @readnone_attr() #0
attributes #0 = { readnone }
// -----
; CHECK: llvm.func @readnone_attr() attributes {llvm.readnone} {
; CHECK: llvm.return
; CHECK: }
define void @readnone_attr() readnone {
entry:
ret void
}