mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
[X86] Add option for enabling LEA optimization pass, by Andrey Turetsky
Add option to enable/disable LEA optimization pass. By default the pass is disabled. Differential Revision: http://reviews.llvm.org/D15573 llvm-svn: 255881
This commit is contained in:
parent
67d14af686
commit
a8fff36021
@ -33,6 +33,10 @@ using namespace llvm;
|
|||||||
|
|
||||||
#define DEBUG_TYPE "x86-optimize-LEAs"
|
#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));
|
||||||
|
|
||||||
STATISTIC(NumSubstLEAs, "Number of LEA instruction substitutions");
|
STATISTIC(NumSubstLEAs, "Number of LEA instruction substitutions");
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -296,7 +300,7 @@ bool OptimizeLEAPass::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
||||||
// Perform this optimization only if we care about code size.
|
// Perform this optimization only if we care about code size.
|
||||||
if (!MF.getFunction()->optForSize())
|
if (!EnableX86LEAOpt || !MF.getFunction()->optForSize())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MRI = &MF.getRegInfo();
|
MRI = &MF.getRegInfo();
|
||||||
|
@ -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.anon1 = type { i32, i32, i32 }
|
||||||
%struct.anon2 = type { i32, [32 x i32], i32 }
|
%struct.anon2 = type { i32, [32 x i32], i32 }
|
||||||
|
Loading…
Reference in New Issue
Block a user