summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2016-11-07 08:49:28 -0800
committer Aart Bik <ajcbik@google.com> 2016-11-09 09:32:36 -0800
commitff7d89c0364f6ebd0f0798eb18ef8bd62917de6a (patch)
tree9a8401416b499f815731fd38dec219a1e49b623d /compiler/optimizing/nodes.h
parent8acdebc1a1b5821d3bb8e9461f7877fc234a37ff (diff)
Allow read side effects for removing dead instructions.
Rationale: Instructions that only have the harmless read side effect may be removed when dead as well, we were too strict previously. As proof of concept, this cl also provides more accurate information on a few string related intrinsics. This removes the dead indexOf from CaffeineString (17% performance improvement, big bottleneck of the StringBuffer's toString() still remains in loop). Test: test-art-host Change-Id: Id835a8e287e13e1f09be6b46278a039b8865802e
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index ce2edde1c1..7890183229 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -1956,7 +1956,7 @@ class HInstruction : public ArenaObject<kArenaAllocInstruction> {
bool IsRemovable() const {
return
- !HasSideEffects() &&
+ !DoesAnyWrite() &&
!CanThrow() &&
!IsSuspendCheck() &&
!IsControlFlow() &&
@@ -3782,6 +3782,8 @@ class HInvoke : public HInstruction {
return GetEnvironment()->IsFromInlinedInvoke();
}
+ void SetCanThrow(bool can_throw) { SetPackedFlag<kFlagCanThrow>(can_throw); }
+
bool CanThrow() const OVERRIDE { return GetPackedFlag<kFlagCanThrow>(); }
bool CanBeMoved() const OVERRIDE { return IsIntrinsic(); }
@@ -3840,8 +3842,6 @@ class HInvoke : public HInstruction {
SetPackedFlag<kFlagCanThrow>(true);
}
- void SetCanThrow(bool can_throw) { SetPackedFlag<kFlagCanThrow>(can_throw); }
-
uint32_t number_of_arguments_;
ArtMethod* const resolved_method_;
ArenaVector<HUserRecord<HInstruction*>> inputs_;