[llvm] [CodeExtractor] Add align metadata to extracted pointers (PR #131131)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 14 08:44:09 PDT 2025


https://github.com/Meinersbur commented:

The LoadInst is loading a member of the struct whose alignment is not necessarily the same as the struct's alignment itself. for instance:

```c
struct {
  char a,b;
  int c;
} MyStruct;
```
`alignof(MyStruct)` should be 4, but `b` will offset 1 and only char-aligned. 

What the alignment of each member is, is determined by the ABI, and I am not sure it will always be the processor's preferred alignment. 

Consider adding alignment info to the store for live-out values as well.

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


More information about the llvm-commits mailing list