This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Purge struct_attr
ClosedPublic

Authored by Dinistro on Feb 7 2023, 12:38 AM.

Details

Summary

This commit removes the llvm.struct_attr which was used to bundle
result attributes that were previously attached to multiple results.
This extension isn't part of LLVM as result attribute semantics cannot
be supported on a struct field granularity.
Furthermore, many usages promoted result attributes to argument
attributes but this does not necessary preserve the semantics.

Diff Detail

Event Timeline

Dinistro created this revision.Feb 7 2023, 12:38 AM
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Feb 7 2023, 12:38 AM
gysit added inline comments.Feb 7 2023, 2:23 AM
mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
97

nit: I would use llvm::append_range.

mlir/test/Conversion/FuncToLLVM/emit-c-wrappers-for-external-functions.mlir
5–6

It may be more opaque pointer compatible if we use check-not

CHECK-NOT:    test.returnOne
CHECK-SAME:  -> ()
Dinistro updated this revision to Diff 495518.Feb 7 2023, 6:49 AM
Dinistro marked an inline comment as done.

address review comments.

The tests should now already support opaque pointers

Dinistro added inline comments.Feb 7 2023, 6:52 AM
mlir/test/Conversion/FuncToLLVM/emit-c-wrappers-for-external-functions.mlir
5–6

It seems that the -> () is not produced for LLVMFuncOp operations so I had to change this a bit.

gysit accepted this revision.Feb 7 2023, 7:05 AM

LGTM modulo possible further test improvements.

mlir/test/Conversion/FuncToLLVM/emit-c-wrappers-for-external-callers.mlir
47

ultra nit: could this be

// CHECK-SAME: !llvm.ptr
// CHECK-SAME: !llvm.ptr
// CHECK-SAME: {test.argOne = 1 : i64}

?

This revision is now accepted and ready to land.Feb 7 2023, 7:05 AM
Dinistro updated this revision to Diff 495534.Feb 7 2023, 7:30 AM
Dinistro marked an inline comment as done.

additional test cleanup

Dinistro marked an inline comment as done.Feb 7 2023, 7:38 AM
This revision was automatically updated to reflect the committed changes.