diff options
| author | Andrey Turetskiy <andrey.turetskiy@gmail.com> | 2016-02-16 16:41:38 +0000 | 
|---|---|---|
| committer | Andrey Turetskiy <andrey.turetskiy@gmail.com> | 2016-02-16 16:41:38 +0000 | 
| commit | eab4e686504f718ade24da40650f6be83680e980 (patch) | |
| tree | 4c37afa999db75f1d19cc112695b698b02edb178 | |
| parent | 442bfcec0077a9de7bd1647f3312c42226132bd2 (diff) | |
| download | bcm5719-llvm-eab4e686504f718ade24da40650f6be83680e980.tar.gz bcm5719-llvm-eab4e686504f718ade24da40650f6be83680e980.zip  | |
[X86] Enable the LEA optimization pass by default.
Differential Revision: http://reviews.llvm.org/D16877
llvm-svn: 260979
| -rw-r--r-- | llvm/lib/Target/X86/X86OptimizeLEAs.cpp | 9 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/lea-opt-memop-check.ll | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/lea-opt.ll | 2 | 
3 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp index def49dfbe5c..65daed2919c 100644 --- a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp +++ b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp @@ -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"); @@ -573,7 +574,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(); diff --git a/llvm/test/CodeGen/X86/lea-opt-memop-check.ll b/llvm/test/CodeGen/X86/lea-opt-memop-check.ll index 1da97997754..34f9f5ebc0a 100644 --- a/llvm/test/CodeGen/X86/lea-opt-memop-check.ll +++ b/llvm/test/CodeGen/X86/lea-opt-memop-check.ll @@ -1,5 +1,5 @@  ; REQUIRES: asserts -; RUN: llc < %s -march=x86 -mtriple=i686-pc-win32 -enable-x86-lea-opt | FileCheck %s +; RUN: llc < %s -march=x86 -mtriple=i686-pc-win32 | FileCheck %s  ; PR26575  ; Assertion `(Disp->isImm() || Disp->isGlobal()) && (Other.Disp->isImm() || Other.Disp->isGlobal()) && "Address displacement operand is always an immediate or a global"' failed. diff --git a/llvm/test/CodeGen/X86/lea-opt.ll b/llvm/test/CodeGen/X86/lea-opt.ll index 20e27773195..4c9187169e5 100644 --- a/llvm/test/CodeGen/X86/lea-opt.ll +++ b/llvm/test/CodeGen/X86/lea-opt.ll @@ -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 }  | 

