From 2767f4ba2df934fea4c50a016e2955c2cf3f6b19 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Fri, 28 Oct 2016 15:03:53 -0700 Subject: New instruction simplifications. Extra dce pass. Allow more per block repeats. Rationale: We were missing some obvious simplifications, which left performance at the table for e.g. CaffeineLogic compiled with dx (4200us->2700us). The constant for allowing a repeat on a BB seemed very low, at the very least it should depend on the BB size. Test: test-art-host Change-Id: Ic234566e117593e12c936d556222e4cd4f928105 --- compiler/optimizing/nodes.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 6a45149509..ce2edde1c1 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -1855,6 +1855,15 @@ class HInstruction : public ArenaObject { size_t InputCount() const { return GetInputRecords().size(); } HInstruction* InputAt(size_t i) const { return InputRecordAt(i).GetInstruction(); } + bool HasInput(HInstruction* input) const { + for (const HInstruction* i : GetInputs()) { + if (i == input) { + return true; + } + } + return false; + } + void SetRawInputAt(size_t index, HInstruction* input) { SetRawInputRecordAt(index, HUserRecord(input)); } -- cgit v1.2.3-59-g8ed1b