Skip to content

Commit 97716d2

Browse files
committed
Revert "CodeGen: Respect function align attribute if less than preferred alignment."
This reverts commit 9878ef3. Needs more discussion of the semantics of the align attribute. See: https://discourse.llvm.org/t/rfc-enhancing-function-alignment-attributes/88019
1 parent 0368e76 commit 97716d2

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

llvm/lib/CodeGen/MachineFunction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ void MachineFunction::init() {
211211
ConstantPool = new (Allocator) MachineConstantPool(getDataLayout());
212212
Alignment = STI.getTargetLowering()->getMinFunctionAlignment();
213213

214-
if (!F.getAlign() && !F.hasOptSize())
214+
// FIXME: Shouldn't use pref alignment if explicit alignment is set on F.
215+
if (!F.hasOptSize())
215216
Alignment = std::max(Alignment,
216217
STI.getTargetLowering()->getPrefFunctionAlignment());
217218

llvm/test/CodeGen/X86/function-align.ll

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)