This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Add comdat attribute to functions
ClosedPublic

Authored by gysit on Jun 25 2023, 11:37 PM.

Details

Summary

This revision adds comdat support to functions. Additionally,
it ensures only comdats that have uses are imported/exported and
only non-empty global comdat operations are created.

Diff Detail

Event Timeline

gysit created this revision.Jun 25 2023, 11:37 PM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
gysit requested review of this revision.Jun 25 2023, 11:37 PM
Dinistro accepted this revision.Jun 26 2023, 8:18 AM

LGTM, module NITs

mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
346

NIT: Is it possible to limit the key type to be the ComdatOp?

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
1810–1814

NIT: This comment is still outdated. It only lists a limited subset of the parsed parts.

mlir/lib/Target/LLVMIR/ModuleImport.cpp
1845

NIT: is there a reason for this change?

This revision is now accepted and ready to land.Jun 26 2023, 8:18 AM
gysit updated this revision to Diff 534583.Jun 26 2023, 8:47 AM
gysit marked 2 inline comments as done.

Address comments.

mlir/lib/Target/LLVMIR/ModuleImport.cpp
1845

I wanted to have the comdats before the metadata. Apart from that I do not have a strong reason.

This revision was landed with ongoing or failed builds.Jun 27 2023, 12:29 AM
This revision was automatically updated to reflect the committed changes.