summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2018-05-11 14:40:31 -0700
committer Aart Bik <ajcbik@google.com> 2018-05-18 11:15:23 -0700
commit4dc09e7261dede72d916059d1f751a48cd08dbb5 (patch)
tree8a04828754b8da25db0b9101021b5bf0880a450b /compiler/optimizing/nodes.cc
parente57a82bd25aa09ca9ad35cb2cb54242d7028f9a0 (diff)
LSE improvement: better singleton array optimization
Rationale: In a recent LSA/LSE refactoring, we removed the "exceptional" situation on mismatched arrays from the load-elimination branch for merged values. As a direct result, we can relax the condition on removing stores for singleton arrays into return blocks a bit, as done in this CL (and shown with some tests). Test: test-art-host,target Bug: b/77906240 Change-Id: I32c89057168730f82d1d7c41155a9ff71b126204
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 5f2833e9a6..7f78dc257e 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -1951,6 +1951,11 @@ bool HBasicBlock::EndsWithControlFlowInstruction() const {
return !GetInstructions().IsEmpty() && GetLastInstruction()->IsControlFlow();
}
+bool HBasicBlock::EndsWithReturn() const {
+ return !GetInstructions().IsEmpty() &&
+ (GetLastInstruction()->IsReturn() || GetLastInstruction()->IsReturnVoid());
+}
+
bool HBasicBlock::EndsWithIf() const {
return !GetInstructions().IsEmpty() && GetLastInstruction()->IsIf();
}