summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetPassConfig.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-05-12 19:29:27 +0000
committerDehao Chen <dehao@google.com>2017-05-12 19:29:27 +0000
commit65dd23e273c5ef69e8ae843ee4fd4664a61d95e9 (patch)
tree4b9e6e179fbbefa74060b0a71ce457f97b742a8c /llvm/lib/CodeGen/TargetPassConfig.cpp
parent10c64e6aea87a75da6dff41a95ede1935282d71d (diff)
downloadbcm5719-llvm-65dd23e273c5ef69e8ae843ee4fd4664a61d95e9.tar.gz
bcm5719-llvm-65dd23e273c5ef69e8ae843ee4fd4664a61d95e9.zip
Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB. Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb Reviewed By: MatzeB, andreadb Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits Differential Revision: https://reviews.llvm.org/D32563 llvm-svn: 302938
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index cbe37c40834..1863d177b21 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -610,6 +610,9 @@ void TargetPassConfig::addMachinePasses() {
addPass(&LocalStackSlotAllocationID, false);
}
+ if (getOptLevel() != CodeGenOpt::None)
+ addPass(&LiveRangeShrinkID);
+
// Run pre-ra passes.
addPreRegAlloc();
OpenPOWER on IntegriCloud