Issue 133599
Summary [AIX] LLVM datalayout is incorrect unless overridden by clang
Labels clang
Assignees
Reporter workingjubilee
    Frontends for LLVM that offer support for the powerpc64-ibm-aix target but do not manually implement [the Clang patch that overrides the data layout](https://github.com/llvm/llvm-project/commit/05ad8e942996f36cc694478542ccd84aa5bbb80f), specifically [here](https://github.com/llvm/llvm-project/blob/d66af9c69b6960ad5f903cc6c0db99395dace6af/clang/lib/Basic/Targets/PPC.h#L406-L413), are using an incorrect data layout. This has resulted in hundreds of hours being wasted on trying to identify bugs due to incompatible layouts in those compilers, partially because of further conflation between the notion of alignment and "preferred" alignment, and the presence of a cryptically-worded "power alignment" rule in IBM's documentation.

As far as I can tell, the so-called "power alignment" rule, if Clang's implementation is correct, merely is a rule that the compiler should align the type on the stack using the "preferred" alignment. It has no other effect. **Even if this happens to affect parameter passing, and is thus required in that case for FFI correctness, then it is not a noteworthy distinction**: other ABIs have far more "interesting" ad-hoc on-stack alignment exceptions. Otherwise, compilers should not need to be told that they may wish to overalign things for their internal stack layouts if it seems performance would benefit, as that would hopefully be obvious.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to