This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add and propagate section attribute for LLVM_GlobalOp
ClosedPublic

Authored by ranjithkh on Apr 21 2021, 5:24 AM.

Details

Summary

Add a section attribute to LLVM_GlobalOp, during module translation attribute value is propagated to llvm

Diff Detail

Event Timeline

ranjithkh created this revision.Apr 21 2021, 5:24 AM
ranjithkh requested review of this revision.Apr 21 2021, 5:24 AM

Can you add the import side (LLVM->MLIR) as well?

rriddle added inline comments.Apr 21 2021, 10:28 PM
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
493

Drop the trivial braces here and throughout the commit.

Harbormaster completed remote builds in B100157: Diff 339477.
mehdi_amini accepted this revision.Apr 22 2021, 5:08 PM
mehdi_amini added inline comments.
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
1003

With this builder by the way? This seems to handle only a subset of the members exposed by this op.

This revision is now accepted and ready to land.Apr 22 2021, 5:08 PM
ftynse accepted this revision.Apr 23 2021, 4:10 AM
ftynse added inline comments.
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
1003

We also don't need builders for all combinations of infrequent attributes. Something like auto op = builder.create<...>(...) followed by op.sectionAttr(value-to-set) works just fine.

ranjithkh added inline comments.Apr 23 2021, 7:49 AM
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
1003

Should I remove this builder or is this good to land?

ftynse added inline comments.Apr 23 2021, 7:52 AM
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
1003

If nobody is using it, let's remove and avoid having dead code in the codebase.

ranjithkh marked an inline comment as done.
sgrechanik accepted this revision.Apr 27 2021, 10:31 AM

Looks like it's it ready to land? I'll merge it tomorrow if there are no more comments.

It's been widely approved I think, usually if the author does not have commit access they leave a note for us to land it for them.

I don't have commit access. Please commit this patch
Name : Ranjith Kumar H
Email : ranjithkh1@gmail.com

This revision was automatically updated to reflect the committed changes.