commit | c9bcbd3474706e1a72f7954b8eea9cb53069d717 | [log] [tgz] |
---|---|---|
author | Alexander Markov <alexmarkov@google.com> | Thu Aug 18 03:22:53 2022 +0000 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Aug 18 03:22:53 2022 +0000 |
tree | 901875fcfe28c767b84d000ca869fe74bdb0eef3 | |
parent | 78b5bb0ae232313d9435c55cd9083e386c338b86 [diff] |
[vm/compiler] Reduce flow graph checks for common constants This change disables certain debug mode checks for commonly used constants which were enabled in https://dart-review.googlesource.com/c/sdk/+/253840. It turns out they affect compilation time considerably in debug mode, especially if low optimization threshold is used and kernel service snapshot is not used (for example in debug/ia32 mode). Time of running standalone_2/regress31114_test in debug/ia32 mode: 78s -> 34s. TEST=CQ + a few debug bots Fixes https://github.com/dart-lang/sdk/issues/49676 Change-Id: I9e09d6e5b9c1c86d9026a924a367301e0dac85b0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255500 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/vm/compiler/backend/flow_graph_checker.cc b/runtime/vm/compiler/backend/flow_graph_checker.cc index 66d2dad..e3f8fdd 100644 --- a/runtime/vm/compiler/backend/flow_graph_checker.cc +++ b/runtime/vm/compiler/backend/flow_graph_checker.cc
@@ -401,6 +401,8 @@ // Initial definitions are partially linked into graph, but some // constants are fully linked into graph (so no next() assert). ASSERT1(def->previous() != nullptr, def); + // Skip checks below for common constants as checking them could be slow. + if (IsCommonConstant(def)) return; } else { // Others are fully linked into graph. ASSERT1(def->next() != nullptr, def);