[clang] [llvm] Global string alignment (PR #142346)
Dominik Steenken via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 2 03:15:12 PDT 2025
================
@@ -52,7 +52,7 @@ GlobalVariable *IRBuilderBase::CreateGlobalString(StringRef Str,
*M, StrConstant->getType(), true, GlobalValue::PrivateLinkage,
StrConstant, Name, nullptr, GlobalVariable::NotThreadLocal, AddressSpace);
GV->setUnnamedAddr(GlobalValue::UnnamedAddr::Global);
- GV->setAlignment(Align(1));
+ GV->setAlignment(M->getDataLayout().getPreferredAlign(GV));
----------------
dominik-steenken wrote:
Well it did change the alignment of the string produced by the PrintFOptimizer from `1` to `2`, which is why i thought i might be on the right track.
https://github.com/llvm/llvm-project/pull/142346
More information about the llvm-commits
mailing list