[llvm] [CodeGen] Don't allow function alignment less than the target's minimum (PR #90415)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 10:09:19 PDT 2024


efriedma-quic wrote:

On 32-bit Arm, function pointer alignment is only 1 byte (8 bits as spelled in the datalayout) because of the way Thumb works.  On 64-bit, 4 bytes should be right.  (And on PPC, it depends on the ABI.)  I've been meaning to extend the function pointer alignment specification to other targets, but didn't get around to it.  Didn't realize it affected this code.

getPointerAlignment queries the datalayout already.  The alternative here is to add some code to clang/lib/Basic/Targets to specify function pointer alignment... (You can't call TargetLowering from clang; clang IR generation is intentionally separated from the backend.)

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


More information about the llvm-commits mailing list