OSDN Git Service

Fix function alignment at -Os on x86 to be 1, not 2. getFunctionAlignment
authorDan Gohman <gohman@apple.com>
Tue, 18 Aug 2009 00:20:06 +0000 (00:20 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 18 Aug 2009 00:20:06 +0000 (00:20 +0000)
returns a log2 value.

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

lib/Target/X86/X86ISelLowering.cpp

index e3fce79..cb5a74f 100644 (file)
@@ -1052,7 +1052,7 @@ SDValue X86TargetLowering::getPICJumpTableRelocBase(SDValue Table,
 
 /// getFunctionAlignment - Return the Log2 alignment of this function.
 unsigned X86TargetLowering::getFunctionAlignment(const Function *F) const {
-  return F->hasFnAttr(Attribute::OptimizeForSize) ? 1 : 4;
+  return F->hasFnAttr(Attribute::OptimizeForSize) ? 0 : 4;
 }
 
 //===----------------------------------------------------------------------===//