This is an archive of the discontinued LLVM Phabricator instance.

Use consistent spacing before custom directives for op and attr/type assemblyFormat.
ClosedPublic

Authored by GleasonK on Nov 17 2022, 1:18 PM.

Details

Summary

Currently, assemblyFormat custom<A>($a) custom<B>($b) has different spacing
if used for Ops vs Attrs/Types. Ops insert a space if needed before the custom directive,
while attributes and types do not.

This leads to the following two patterns in attributes / types:

# 1. Whitespace literal
let assemblyFormat = "... ` ` custom<A>($a)"


# 2. Custom printer code includes spacing
void printB(...) {
  printer << ' ' << b;
}

Moving this spacing into the generated code allows for some cleanup in mlir and
improves the consistency of custom directives.

Diff Detail

Event Timeline

GleasonK created this revision.Nov 17 2022, 1:18 PM
Herald added a project: Restricted Project. · View Herald Transcript
GleasonK requested review of this revision.Nov 17 2022, 1:18 PM
mehdi_amini accepted this revision.Nov 17 2022, 10:16 PM
This revision is now accepted and ready to land.Nov 17 2022, 10:16 PM

Relatively new to the LLVM community, and unsure of review conventions. I see this is marked as" accepted and ready to land", unsure if I am still waiting on feedback from remaining reviewers.

If not, could someone with commit access land this for me? I rebased and built MLIR locally, changes don't appear to be stale yet.

Apologies for the delay. Landing