ARM function alignments were off by a power of two. svn 83242 changed
authorBob Wilson <bob.wilson@apple.com>
Thu, 1 Jul 2010 22:26:26 +0000 (22:26 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 1 Jul 2010 22:26:26 +0000 (22:26 +0000)
getFunctionAlignment and the corresponding use of that value in the ARM
asm printer, but now we're using the standard asm printer.  The result of
this was that function alignments were dropped completely for Thumb functions.
Radar 8143571.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107435 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/Thumb/2010-07-01-FuncAlign.ll [new file with mode: 0644]

index 5f07eee0d5d992d8f917385449dd4f936e1dd449..d8b08d8e2ea8f01f782341752018ec7ca7c06bbc 100644 (file)
@@ -647,7 +647,7 @@ TargetRegisterClass *ARMTargetLowering::getRegClassFor(EVT VT) const {
 
 /// getFunctionAlignment - Return the Log2 alignment of this function.
 unsigned ARMTargetLowering::getFunctionAlignment(const Function *F) const {
-  return getTargetMachine().getSubtarget<ARMSubtarget>().isThumb() ? 0 : 1;
+  return getTargetMachine().getSubtarget<ARMSubtarget>().isThumb() ? 1 : 2;
 }
 
 Sched::Preference ARMTargetLowering::getSchedulingPreference(SDNode *N) const {
diff --git a/test/CodeGen/Thumb/2010-07-01-FuncAlign.ll b/test/CodeGen/Thumb/2010-07-01-FuncAlign.ll
new file mode 100644 (file)
index 0000000..8e09441
--- /dev/null
@@ -0,0 +1,6 @@
+; RUN: llc < %s -mtriple=thumb-apple-darwin | FileCheck %s
+; Radar 8143571: Function alignments were off by a power of two.
+; CHECK: .align 1
+define void @test() {
+  ret void
+}