summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-04-11 16:03:07 +0000
committerReid Kleckner <rnk@google.com>2018-04-11 16:03:07 +0000
commit0828699488b0baaf532cda149877f1de1e11210b (patch)
tree739e56b90d742cbfe6d0774cb43c514c880e1aa0 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parentff98682c9c60b57e09937abfd3436520232a9bdc (diff)
downloadbcm5719-llvm-0828699488b0baaf532cda149877f1de1e11210b.tar.gz
bcm5719-llvm-0828699488b0baaf532cda149877f1de1e11210b.zip
[FastISel] Disable local value sinking by default
This is causing compilation timeouts on code with long sequences of local values and calls (i.e. foo(1); foo(2); foo(3); ...). It turns out that code coverage instrumentation is a great way to create sequences like this, which how our users ran into the issue in practice. Intel has a tool that detects these kinds of non-linear compile time issues, and Andy Kaylor reported it as PR37010. The current sinking code scans the whole basic block once per local value sink, which happens before emitting each call. In theory, local values should only be introduced to be used by instructions between the current flush point and the last flush point, so we should only need to scan those instructions. llvm-svn: 329822
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 601691a795a..a88359ff27a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -113,6 +113,13 @@ using namespace llvm;
#define DEBUG_TYPE "isel"
+// FIXME: Remove this when compile time issues are addressed. Do this by only
+// numbering instructions between local value map flush points instead of the
+// entire BB.
+static cl::opt<bool> SinkLocalValues("fast-isel-sink-local-values",
+ cl::init(false), cl::Hidden,
+ cl::desc("Sink local values in FastISel"));
+
STATISTIC(NumFastIselSuccessIndependent, "Number of insts selected by "
"target-independent selector");
STATISTIC(NumFastIselSuccessTarget, "Number of insts selected by "
@@ -180,7 +187,7 @@ void FastISel::flushLocalValueMap() {
// Try to sink local values down to their first use so that we can give them a
// better debug location. This has the side effect of shrinking local value
// live ranges, which helps out fast regalloc.
- if (LastLocalValue != EmitStartPt) {
+ if (SinkLocalValues && LastLocalValue != EmitStartPt) {
// Sink local value materialization instructions between EmitStartPt and
// LastLocalValue. Visit them bottom-up, starting from LastLocalValue, to
// avoid inserting into the range that we're iterating over.
OpenPOWER on IntegriCloud