This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVM] Replace readnone with memory effects

Authored by Dinistro on Jan 18 2023, 6:18 AM.



This commit introduces LLVM's MemoryEffects attribute and replaces the
deprecated usage of llvm.readnone in the LLVM dialect.
The absence of the attribute on a LLVMFuncOp implies that it might
access all kinds of memory. This semantic corresponds to llvm::Function's

Depends on D142002

Diff Detail

Event Timeline

Dinistro created this revision.Jan 18 2023, 6:18 AM
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Jan 18 2023, 6:18 AM
gysit added inline comments.Jan 18 2023, 7:01 AM

nit: I think most other attributes use camelCase for LLVM attribute names infavor of using them as is.


nit: I would compute the attribute here and then use setMemoryAttr on the newFuncOp further below. That way we do not use the string to identify the right attribute.


It does not seem like the function ever return failure?

1–18 ↗(On Diff #490129)

is this file accidentally here? Generally it may be a good idea to factor out a separate test for the function attributes? However this seems to be a copy?

Dinistro updated this revision to Diff 490151.Jan 18 2023, 7:26 AM
Dinistro marked 4 inline comments as done.

addressing review comments

gysit accepted this revision.Jan 18 2023, 8:24 AM


This revision is now accepted and ready to land.Jan 18 2023, 8:24 AM
This revision was automatically updated to reflect the committed changes.