[llvm-commits] [llvm] r143002 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll

Evan Cheng evan.cheng at apple.com
Tue Oct 25 18:17:44 PDT 2011


Author: evancheng
Date: Tue Oct 25 20:17:44 2011
New Revision: 143002

URL: http://llvm.org/viewvc/llvm-project?rev=143002&view=rev
Log:
Revert part of r142530. The patch potentially hurts performance especially
on Darwin platforms where -Os means optimize for size without hurting
performance.

Modified:
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
    llvm/trunk/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=143002&r1=143001&r2=143002&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Oct 25 20:17:44 2011
@@ -2106,8 +2106,9 @@
   // 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 @@
   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.

Modified: llvm/trunk/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll?rev=143002&r1=143001&r2=143002&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/2011-10-18-DisableMovtSize.ll Tue Oct 25 20:17:44 2011
@@ -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





More information about the llvm-commits mailing list