[llvm] [PowerPC] Alignment of toc-data symbol should not be increased during optimizations (PR #94593)

Sean Fertile via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 07:12:20 PDT 2024


================
@@ -335,6 +335,14 @@ bool GlobalObject::canIncreaseAlignment() const {
   if (isELF && !isDSOLocal())
     return false;
 
+  bool isXCOFF =
+      (!Parent || Triple(Parent->getTargetTriple()).isOSBinFormatXCOFF());
+  if (isXCOFF)
+    if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))
+      // GV with toc-data attribute is put in the region same as toc entry.
----------------
mandlebug wrote:

```suggestion
      // GV with toc-data attribute is defined in a TOC entry which 
      // has a fixed alignment and cannot be arbitrarily increased.
```

https://github.com/llvm/llvm-project/pull/94593


More information about the llvm-commits mailing list