summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-29 16:39:22 +0000
committerDan Gohman <gohman@apple.com>2010-08-29 16:39:22 +0000
commit4f7e18dee35c55e4e719f5fb73726ab035a7e5db (patch)
tree019bd777f28f27a3c6808398f0331928ed2a8b8b
parent25608f7f4b352aa3ff6004aadde11dc86ff85eda (diff)
downloadllvm-4f7e18dee35c55e4e719f5fb73726ab035a7e5db.tar.gz
llvm-4f7e18dee35c55e4e719f5fb73726ab035a7e5db.tar.bz2
llvm-4f7e18dee35c55e4e719f5fb73726ab035a7e5db.tar.xz
Optionally rerun dedicated-register filtering after applying
other filtering techniques, as those may allow it to filter out more obviously unprofitable candidates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112441 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 8a68806399..4fe93b9d41 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1391,6 +1391,7 @@ public:
size_t EstimateSearchSpaceComplexity() const;
void NarrowSearchSpaceByDetectingSupersets();
void NarrowSearchSpaceByCollapsingUnrolledCode();
+ void NarrowSearchSpaceByRefilteringUndesirableDedicatedRegisters();
void NarrowSearchSpaceByPickingWinnerRegs();
void NarrowSearchSpaceUsingHeuristics();
@@ -3104,6 +3105,24 @@ void LSRInstance::NarrowSearchSpaceByCollapsingUnrolledCode() {
}
}
+/// NarrowSearchSpaceByRefilteringUndesirableDedicatedRegisters - Call
+/// FilterOutUndesirableDedicatedRegisters again, if necessary, now that
+/// we've done more filtering, as it may be able to find more formulae to
+/// eliminate.
+void LSRInstance::NarrowSearchSpaceByRefilteringUndesirableDedicatedRegisters(){
+ if (EstimateSearchSpaceComplexity() >= ComplexityLimit) {
+ DEBUG(dbgs() << "The search space is too complex.\n");
+
+ DEBUG(dbgs() << "Narrowing the search space by re-filtering out "
+ "undesirable dedicated registers.\n");
+
+ FilterOutUndesirableDedicatedRegisters();
+
+ DEBUG(dbgs() << "After pre-selection:\n";
+ print_uses(dbgs()));
+ }
+}
+
/// NarrowSearchSpaceByPickingWinnerRegs - Pick a register which seems likely
/// to be profitable, and then in any use which has any reference to that
/// register, delete all formulae which do not reference that register.
@@ -3176,6 +3195,7 @@ void LSRInstance::NarrowSearchSpaceByPickingWinnerRegs() {
void LSRInstance::NarrowSearchSpaceUsingHeuristics() {
NarrowSearchSpaceByDetectingSupersets();
NarrowSearchSpaceByCollapsingUnrolledCode();
+ NarrowSearchSpaceByRefilteringUndesirableDedicatedRegisters();
NarrowSearchSpaceByPickingWinnerRegs();
}