File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -211,9 +211,8 @@ void MachineFunction::init() {
211
211
ConstantPool = new (Allocator) MachineConstantPool (getDataLayout ());
212
212
Alignment = STI->getTargetLowering ()->getMinFunctionAlignment ();
213
213
214
- // FIXME: Shouldn't use pref alignment if explicit alignment is set on F.
215
214
// FIXME: Use Function::hasOptSize().
216
- if (!F.hasFnAttribute (Attribute::OptimizeForSize))
215
+ if (!F.getAlign () && !F. hasFnAttribute (Attribute::OptimizeForSize))
217
216
Alignment = std::max (Alignment,
218
217
STI->getTargetLowering ()->getPrefFunctionAlignment ());
219
218
Original file line number Diff line number Diff line change
1
+ ; RUN: llc -function-sections < %s | FileCheck %s
2
+
3
+ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4
+ target triple = "x86_64-unknown-linux-gnu"
5
+
6
+ ; CHECK: .section .text.f1
7
+ ; CHECK-NOT: .p2align
8
+ ; CHECK: f1:
9
+ define void @f1 () align 1 {
10
+ ret void
11
+ }
12
+
13
+ ; CHECK: .section .text.f2
14
+ ; CHECK-NEXT: .globl f2
15
+ ; CHECK-NEXT: .p2align 1
16
+ define void @f2 () align 2 {
17
+ ret void
18
+ }
You can’t perform that action at this time.
0 commit comments