No SuspendChecks when branching to return block
The return basic block is usually placed at the beginning of the DEX
file, making the branches to it back edges where the Optimizing's
graph builder places SuspendCheck instructions, only to be removed
later by the instruction_simplifier pass. Since huge auto-generated
methods tend to contain hundreds/thousands of these, this patch
recognizes the pattern and prevents builder from generating the
redundant check in the first place.
Change-Id: I065a3c2f71964b8fc2e53dc20730ba42938b78a1
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index 592db23..8ee27a1 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -106,7 +106,7 @@
HLocal* GetLocalAt(int register_index) const;
void UpdateLocal(int register_index, HInstruction* instruction) const;
HInstruction* LoadLocal(int register_index, Primitive::Type type) const;
- void PotentiallyAddSuspendCheck(int32_t target_offset, uint32_t dex_pc);
+ void PotentiallyAddSuspendCheck(HBasicBlock* target, uint32_t dex_pc);
void InitializeParameters(uint16_t number_of_parameters);
bool NeedsAccessCheck(uint32_t type_index) const;