summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetMachine.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-12-04 10:53:15 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-12-04 10:53:15 +0000
commit7cf324772fdeff1db07e6aea8f8f57242f7b9945 (patch)
tree1515710008c9c116086791fb7717bfa8d3c2e124 /llvm/lib/Target/X86/X86TargetMachine.cpp
parent1e577e66e9b50659ecee42b581f7f31a9d4d3d9b (diff)
downloadbcm5719-llvm-7cf324772fdeff1db07e6aea8f8f57242f7b9945.tar.gz
bcm5719-llvm-7cf324772fdeff1db07e6aea8f8f57242f7b9945.zip
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
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/X86/X86TargetMachine.cpp3
1 files changed, 3 insertions, 0 deletions
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());
}
OpenPOWER on IntegriCloud