summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2016-10-28 15:03:53 -0700
committer Aart Bik <ajcbik@google.com> 2016-11-02 14:45:36 -0700
commit2767f4ba2df934fea4c50a016e2955c2cf3f6b19 (patch)
tree2676ce7b335cc0ce197a4754ed62fc114647ba4d /compiler/optimizing/nodes.h
parent77a0e4541a29c26dba21ed8c1ed1c29ef8d0ce4c (diff)
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
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h9
1 files changed, 9 insertions, 0 deletions
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<kArenaAllocInstruction> {
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<HInstruction*>(input));
}