diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2025-08-22 12:59:54 -0700 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2025-08-22 13:17:53 -0700 |
commit | 97716d2e311aed1b3b73461ee83e53faa512e499 (patch) | |
tree | c0b57bcc639bf484a800a0090ff1381c87541b62 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 0368e76fded6565d8613645d11ea752b5c4a2ed5 (diff) | |
download | llvm-97716d2e311aed1b3b73461ee83e53faa512e499.zip llvm-97716d2e311aed1b3b73461ee83e53faa512e499.tar.gz llvm-97716d2e311aed1b3b73461ee83e53faa512e499.tar.bz2 |
Revert "CodeGen: Respect function align attribute if less than preferred alignment."
This reverts commit 9878ef3abd2a48fcfb81357d581dac292b52ddb3.
Needs more discussion of the semantics of the align attribute. See:
https://discourse.llvm.org/t/rfc-enhancing-function-alignment-attributes/88019
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 82ba596..224231c 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -211,7 +211,8 @@ void MachineFunction::init() { ConstantPool = new (Allocator) MachineConstantPool(getDataLayout()); Alignment = STI.getTargetLowering()->getMinFunctionAlignment(); - if (!F.getAlign() && !F.hasOptSize()) + // FIXME: Shouldn't use pref alignment if explicit alignment is set on F. + if (!F.hasOptSize()) Alignment = std::max(Alignment, STI.getTargetLowering()->getPrefFunctionAlignment()); |