[llvm] [LangRef] Add description of toc-data global variables (PR #94828)

Kai Luo via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 19:15:20 PDT 2024


https://github.com/bzEq updated https://github.com/llvm/llvm-project/pull/94828

>From 4d0ee177d5bba8147b5dd7f31d5151ff8ff29322 Mon Sep 17 00:00:00 2001
From: Kai Luo <lkail at cn.ibm.com>
Date: Sat, 8 Jun 2024 10:10:15 +0800
Subject: [PATCH 1/2] Add description of toc-data global variables

---
 llvm/docs/LangRef.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 9fb2c048a5c86..093f9e4c62086 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -812,6 +812,9 @@ doesn't). These kinds of structs (we may call them homogeneous scalable vector
 structs) are considered sized and can be used in loads, stores, allocas, but
 not GEPs.
 
+Globals with ``toc-data`` attribute set are stored in TOC of XCOFF. Their
+alignments are the same as that of a TOC entry.
+
 Syntax::
 
       @<GlobalVarName> = [Linkage] [PreemptionSpecifier] [Visibility]

>From 4ecfa535df1ceea68e964af759e4a6883a8a6c80 Mon Sep 17 00:00:00 2001
From: Kai Luo <lkail at cn.ibm.com>
Date: Sat, 8 Jun 2024 10:15:06 +0800
Subject: [PATCH 2/2] Up

---
 llvm/docs/LangRef.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 093f9e4c62086..ea1f4296ba4dc 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -813,7 +813,8 @@ structs) are considered sized and can be used in loads, stores, allocas, but
 not GEPs.
 
 Globals with ``toc-data`` attribute set are stored in TOC of XCOFF. Their
-alignments are the same as that of a TOC entry.
+alignments are not larger than that of a TOC entry. Optimizations should not
+increase their alignments to prevent TOC overflow.
 
 Syntax::
 



More information about the llvm-commits mailing list