OSDN Git Service

[X86] Enable the LEA optimization pass by default.
authorAndrey Turetskiy <andrey.turetskiy@gmail.com>
Thu, 11 Feb 2016 10:51:26 +0000 (10:51 +0000)
committerAndrey Turetskiy <andrey.turetskiy@gmail.com>
Thu, 11 Feb 2016 10:51:26 +0000 (10:51 +0000)
Differential Revision: http://reviews.llvm.org/D16877

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

lib/Target/X86/X86OptimizeLEAs.cpp
test/CodeGen/X86/lea-opt.ll

index 9f7de9a..d11d787 100644 (file)
@@ -35,9 +35,10 @@ using namespace llvm;
 
 #define DEBUG_TYPE "x86-optimize-LEAs"
 
-static cl::opt<bool> EnableX86LEAOpt("enable-x86-lea-opt", cl::Hidden,
-                                     cl::desc("X86: Enable LEA optimizations."),
-                                     cl::init(false));
+static cl::opt<bool>
+    DisableX86LEAOpt("disable-x86-lea-opt", cl::Hidden,
+                     cl::desc("X86: Disable LEA optimizations."),
+                     cl::init(false));
 
 STATISTIC(NumSubstLEAs, "Number of LEA instruction substitutions");
 STATISTIC(NumRedundantLEAs, "Number of redundant LEA instructions removed");
@@ -568,7 +569,7 @@ bool OptimizeLEAPass::runOnMachineFunction(MachineFunction &MF) {
   bool Changed = false;
 
   // Perform this optimization only if we care about code size.
-  if (!EnableX86LEAOpt || !MF.getFunction()->optForSize())
+  if (DisableX86LEAOpt || !MF.getFunction()->optForSize())
     return false;
 
   MRI = &MF.getRegInfo();
index 20e2777..4c91871 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-linux -enable-x86-lea-opt | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
 
 %struct.anon1 = type { i32, i32, i32 }
 %struct.anon2 = type { i32, [32 x i32], i32 }