diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-10-26 01:17:44 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-10-26 01:17:44 +0000 |
commit | f31151f34ec37dd49bdf998e9e352d572f4a8e06 (patch) | |
tree | b191b52e9236d2fbd084cd926c9cffeafa1ac5c1 | |
parent | a823e3d42c48ceeb2f5011f7402031bf02fa0fe1 (diff) |
Revert part of r142530. The patch potentially hurts performance especially
on Darwin platforms where -Os means optimize for size without hurting
performance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143002 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 6 | ||||
-rw-r--r-- | test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 3f913ded1d..fa5f0be1d7 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -2106,8 +2106,9 @@ SDValue ARMTargetLowering::LowerGlobalAddressELF(SDValue Op, // If we have T2 ops, we can materialize the address directly via movt/movw // pair. This is always cheaper in terms of performance, but uses at least 2 // extra bytes. + MachineFunction &MF = DAG.getMachineFunction(); if (Subtarget->useMovt() && - !DAG.getMachineFunction().getFunction()->hasFnAttr(Attribute::OptimizeForSize)) { + !MF.getFunction()->hasFnAttr(Attribute::OptimizeForSize)) { ++NumMovwMovt; // FIXME: Once remat is capable of dealing with instructions with register // operands, expand this into two nodes. @@ -2132,8 +2133,7 @@ SDValue ARMTargetLowering::LowerGlobalAddressDarwin(SDValue Op, ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); // FIXME: Enable this for static codegen when tool issues are fixed. - if (Subtarget->useMovt() && RelocM != Reloc::Static && - !DAG.getMachineFunction().getFunction()->hasFnAttr(Attribute::OptimizeForSize)) { + if (Subtarget->useMovt() && RelocM != Reloc::Static) { ++NumMovwMovt; // FIXME: Once remat is capable of dealing with instructions with register // operands, expand this into two nodes. diff --git a/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll b/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll index 6dae75be91..4f84ab09e4 100644 --- a/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll +++ b/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll @@ -1,4 +1,3 @@ -; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s ; RUN: llc < %s -mtriple=armv7-unknown-linux-eabi | FileCheck %s ; Check that when optimizing for size, a literal pool load is used |