@@ -1659,6 +1659,22 @@ def SignedOverflowBehaviorEnum : I32EnumAttr<
1659
1659
let cppNamespace = "::mlir::cir::sob";
1660
1660
}
1661
1661
1662
+ /// Definition of TLS related kinds.
1663
+ def TLS_GeneralDynamic :
1664
+ I32EnumAttrCase<"GeneralDynamic", 0, "tls_dyn">;
1665
+ def TLS_LocalDynamic :
1666
+ I32EnumAttrCase<"LocalDynamic", 1, "tls_local_dyn">;
1667
+ def TLS_InitialExec :
1668
+ I32EnumAttrCase<"InitialExec", 2, "tls_init_exec">;
1669
+ def TLS_LocalExec :
1670
+ I32EnumAttrCase<"LocalExec", 3, "tls_local_exec">;
1671
+
1672
+ def TLSModel : I32EnumAttr<
1673
+ "TLS_Model",
1674
+ "TLS model",
1675
+ [TLS_GeneralDynamic, TLS_LocalDynamic, TLS_InitialExec, TLS_LocalExec]> {
1676
+ let cppNamespace = "::mlir::cir";
1677
+ }
1662
1678
1663
1679
def GlobalOp : CIR_Op<"global", [Symbol, DeclareOpInterfaceMethods<RegionBranchOpInterface>, NoRegionArguments]> {
1664
1680
let summary = "Declares or defines a global variable";
@@ -1694,6 +1710,7 @@ def GlobalOp : CIR_Op<"global", [Symbol, DeclareOpInterfaceMethods<RegionBranchO
1694
1710
OptionalAttr<StrAttr>:$sym_visibility,
1695
1711
TypeAttr:$sym_type,
1696
1712
Arg<GlobalLinkageKind, "linkage type">:$linkage,
1713
+ OptionalAttr<TLSModel>:$tls_model,
1697
1714
// Note this can also be a FlatSymbolRefAttr
1698
1715
OptionalAttr<AnyAttr>:$initial_value,
1699
1716
UnitAttr:$constant,
@@ -1706,6 +1723,7 @@ def GlobalOp : CIR_Op<"global", [Symbol, DeclareOpInterfaceMethods<RegionBranchO
1706
1723
($sym_visibility^)?
1707
1724
(`constant` $constant^)?
1708
1725
$linkage
1726
+ ($tls_model^)?
1709
1727
$sym_name
1710
1728
custom<GlobalOpTypeAndInitialValue>($sym_type, $initial_value, $ctorRegion, $dtorRegion)
1711
1729
attr-dict
0 commit comments