summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
author Stelios Ioannou <stelios.ioannou@linaro.org> 2021-07-09 17:06:03 +0100
committer Treehugger Robot <treehugger-gerrit@google.com> 2021-09-13 17:54:53 +0000
commit3de02fb67de386368c9fe39ab5a0133afcf1d785 (patch)
tree39b82839945a26dfb857a403effa4ba248145715 /compiler/optimizing/code_generator.cc
parent18074d2b59ae56dcfccea770ceb515215c8eb53f (diff)
ART: Removes SuspendCheck for plain loops with a low trip count.
This change removes SuspendCheck for plain loops with a low trip count. The SuspendCheck in the codegen makes sure that the thread can be interrupted during execution for GC. Not being able to do so might decrease the responsiveness of GC in the case when a very long loop or a long recursion is being executed. However, for plain loops with a small trip count, the removal of SuspendCheck should not affect the GC's responsiveness by a large margin. Consequently, since the thread won't be interrupted for plain loops, it is assumed that the performance might increase by removing SuspendCheck. Test: art/test.py -v -j12 --host --64 -t 2233-checker\ -remove-loop-suspend-check --run-test --optimizing Change-Id: Ic9f1387059669645ad836d8277bfbc7553aa6e2f
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index a164b15a04..a353d0758e 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -1114,7 +1114,7 @@ static void CheckLoopEntriesCanBeUsedForOsr(const HGraph& graph,
for (HBasicBlock* block : graph.GetReversePostOrder()) {
if (block->IsLoopHeader()) {
HSuspendCheck* suspend_check = block->GetLoopInformation()->GetSuspendCheck();
- if (!suspend_check->GetEnvironment()->IsFromInlinedInvoke()) {
+ if (suspend_check != nullptr && !suspend_check->GetEnvironment()->IsFromInlinedInvoke()) {
loop_headers.push_back(suspend_check);
}
}