[Flang][MLIR] Alter Fir.GlobalOp to print and lower external attributes
authorAndrew Gozillon <Andrew.Gozillon@amd.com>
Thu, 20 Apr 2023 12:05:17 +0000 (07:05 -0500)
committerAndrew Gozillon <Andrew.Gozillon@amd.com>
Thu, 20 Apr 2023 12:06:05 +0000 (07:06 -0500)
commit6b44274d8309c4e8daeecdcc6a14259015a3923f
treea00a326bf748cbe3c4abe215c9be3d4d7108a95a
parent2e275e24355cb224981f9beb2b026a3169fc7232
[Flang][MLIR] Alter Fir.GlobalOp to print and lower external attributes

Fir.GlobalOp's currently do not respect attributes that
are applied to them, this change will do two things:

- Allow lowering of arbitrary attributes applied to
Fir.GlobalOp's to LLVMGlobalOp's during CodeGen
- Allow printing and parsing of arbitrarily applied attributes

This allows applying other dialects attributes (or other
fir attributes) to fir.GlobalOps on the fly and have them
exist in the resulting LLVM dialect IR or FIR IR.

Reviewer: jeanPerier

Differential Revision: https://reviews.llvm.org/D148352
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/test/Fir/global-attributes.fir [new file with mode: 0644]