diff options
author | Hans Wennborg <hans@hanshq.net> | 2016-02-17 02:49:59 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2016-02-17 02:49:59 +0000 |
commit | 84047896b94032dcd9d11e8cefa928cd2be13197 (patch) | |
tree | 26fb0db0824abaff1b1700eb7b5f7baf33a8eb22 | |
parent | c902fed440b7284ff26b7a9cfd3091c98da240d9 (diff) | |
download | bcm5719-llvm-84047896b94032dcd9d11e8cefa928cd2be13197.tar.gz bcm5719-llvm-84047896b94032dcd9d11e8cefa928cd2be13197.zip |
Revert r260979 "[X86] Enable the LEA optimization pass by default."
Asserts are still firing in Chromium builds. PR26575.
llvm-svn: 261058
-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, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp index 65daed2919c..def49dfbe5c 100644 --- a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp +++ b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp @@ -35,10 +35,9 @@ using namespace llvm; #define DEBUG_TYPE "x86-optimize-LEAs" -static cl::opt<bool> - DisableX86LEAOpt("disable-x86-lea-opt", cl::Hidden, - cl::desc("X86: Disable LEA optimizations."), - cl::init(false)); +static cl::opt<bool> EnableX86LEAOpt("enable-x86-lea-opt", cl::Hidden, + cl::desc("X86: Enable LEA optimizations."), + cl::init(false)); STATISTIC(NumSubstLEAs, "Number of LEA instruction substitutions"); STATISTIC(NumRedundantLEAs, "Number of redundant LEA instructions removed"); @@ -574,7 +573,7 @@ bool OptimizeLEAPass::runOnMachineFunction(MachineFunction &MF) { bool Changed = false; // Perform this optimization only if we care about code size. - if (DisableX86LEAOpt || !MF.getFunction()->optForSize()) + if (!EnableX86LEAOpt || !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 34f9f5ebc0a..1da97997754 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 | FileCheck %s +; RUN: llc < %s -march=x86 -mtriple=i686-pc-win32 -enable-x86-lea-opt | 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 4c9187169e5..20e27773195 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 | FileCheck %s +; RUN: llc < %s -mtriple=x86_64-linux -enable-x86-lea-opt | FileCheck %s %struct.anon1 = type { i32, i32, i32 } %struct.anon2 = type { i32, [32 x i32], i32 } |