This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Add UnnamedAddr attribute to GlobalOp
ClosedPublic

Authored by clementval on Apr 16 2021, 12:13 PM.

Details

Summary

This patch add the UnnamedAddr attribute for the GlobalOp in the LLVM
dialect. The attribute is also handled to and from LLVM IR.

This is meant to be used in a follow up patch to lower OpenACC/OpenMP ops to
call to kmp and tgt runtime calls (D100678).

Diff Detail

Event Timeline

clementval created this revision.Apr 16 2021, 12:13 PM
clementval requested review of this revision.Apr 16 2021, 12:13 PM
clementval edited the summary of this revision. (Show Details)Apr 16 2021, 12:43 PM

Can you add a test for the conversion back and forth with LLVM IR?

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
412

Nit, remove spurious braces.

mlir/test/Dialect/LLVMIR/global.mlir
67

Can we get some pretty print for this?

clementval marked an inline comment as done.

Address review comment

clementval marked an inline comment as done.Apr 17 2021, 12:27 PM

@mehdi_amini Thanks for the quick review. I added some tests to/from LLVM IR and addressed other comments.

mlir/test/Dialect/LLVMIR/global.mlir
67

parsing + pretty print added.

mehdi_amini accepted this revision.Apr 17 2021, 8:33 PM

Tests are marked as failing by the pre-merge checks? Otherwise LG after you get these to work as expected!

This revision is now accepted and ready to land.Apr 17 2021, 8:33 PM
clementval marked an inline comment as done.

Fix tests

This revision was automatically updated to reflect the committed changes.