[llvm-commits] [llvm] r107435 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/Thumb/2010-07-01-FuncAlign.ll

Bob Wilson bob.wilson at apple.com
Thu Jul 1 15:26:26 PDT 2010


Author: bwilson
Date: Thu Jul  1 17:26:26 2010
New Revision: 107435

URL: http://llvm.org/viewvc/llvm-project?rev=107435&view=rev
Log:
ARM function alignments were off by a power of two.  svn 83242 changed
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.

Added:
    llvm/trunk/test/CodeGen/Thumb/2010-07-01-FuncAlign.ll
Modified:
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=107435&r1=107434&r2=107435&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jul  1 17:26:26 2010
@@ -647,7 +647,7 @@
 
 /// 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 {

Added: llvm/trunk/test/CodeGen/Thumb/2010-07-01-FuncAlign.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/2010-07-01-FuncAlign.ll?rev=107435&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb/2010-07-01-FuncAlign.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb/2010-07-01-FuncAlign.ll Thu Jul  1 17:26:26 2010
@@ -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
+}





More information about the llvm-commits mailing list