diff options
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 367f45f3a4..bf4a66dfc3 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2448,18 +2448,26 @@ class HInstruction : public ArenaObject<kArenaAllocInstruction> { bool IsRemovable() const { return !DoesAnyWrite() && - !CanThrow() && + // TODO(solanes): Merge calls from IsSuspendCheck to IsControlFlow into one that doesn't + // do virtual dispatching. !IsSuspendCheck() && - !IsControlFlow() && !IsNop() && !IsParameterValue() && // If we added an explicit barrier then we should keep it. !IsMemoryBarrier() && - !IsConstructorFence(); + !IsConstructorFence() && + !IsControlFlow() && + !CanThrow(); } bool IsDeadAndRemovable() const { - return IsRemovable() && !HasUses(); + return !HasUses() && IsRemovable(); + } + + bool IsPhiDeadAndRemovable() const { + DCHECK(IsPhi()); + DCHECK(IsRemovable()) << " phis are always removable"; + return !HasUses(); } // Does this instruction dominate `other_instruction`? |