[clang] [llvm] Global string alignment (PR #142346)

Dominik Steenken via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 01:48:55 PDT 2025


dominik-steenken wrote:

Ok. As far as i can tell, 
```C++
M->getDataLayout().getPrefTypeAlign(getInt8Ty())
```
should be functionally equivalent to
```C++
M->getDataLayout().getPreferredAlign(GV)
```
with the exception that the latter potentially preserves a preexisting alignment on the `GV`, which is not relevant for this case, right?

In any case, i've reverted my changes to copy the alignment, and changed `IRBuilder::createGlobalString` in the suggested way.

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


More information about the llvm-commits mailing list