[llvm] [MTE] generalize overalignment / size of MTE globals (PR #121957)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 08:27:31 PST 2025


================
@@ -2422,8 +2428,10 @@ static void tagGlobalDefinition(Module &M, GlobalVariable *G) {
     G = NewGV;
   }
 
-  if (G->getAlign().valueOrOne() < 16)
-    G->setAlignment(Align(16));
+  if (auto Align = G->getRequiredGlobalAlignment()) {
+    assert(*Align > G->getAlign().valueOrOne());
+    G->setAlignment(*Align);
+  }
 
   // Ensure that tagged globals don't get merged by ICF - as they should have
----------------
jrtc27 wrote:

This is specific to MTE-like things and should be independent from the generic align+pad code

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


More information about the llvm-commits mailing list