From 7cf324772fdeff1db07e6aea8f8f57242f7b9945 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 4 Dec 2015 10:53:15 +0000 Subject: LEA code size optimization pass (Part 1): Remove redundant address recalculations, by Andrey Turetsky Add new x86 pass which replaces address calculations in load or store instructions with def register of existing LEA (must be in the same basic block), if the LEA calculates address that differs only by a displacement. Works only with -Os or -Oz. Differential Revision: http://reviews.llvm.org/D13294 llvm-svn: 254712 --- llvm/lib/Target/X86/X86TargetMachine.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp') diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 2e869eb7c3c..0e7e4c0c84a 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -254,6 +254,9 @@ bool X86PassConfig::addPreISel() { } void X86PassConfig::addPreRegAlloc() { + if (getOptLevel() != CodeGenOpt::None) + addPass(createX86OptimizeLEAs()); + addPass(createX86CallFrameOptimization()); } -- cgit v1.2.3