diff options
| author | 2014-09-15 18:29:00 +0100 | |
|---|---|---|
| committer | 2014-09-17 18:23:21 +0100 | |
| commit | 72bceff11a98cc1ecdb64a6fae16c521f99ec6a7 (patch) | |
| tree | d326cc4fd32315735466efbb17ea22adf121395c /compiler/optimizing/nodes.h | |
| parent | ccc07a9579c554443cd03a306ca9b4f943fd2a93 (diff) | |
Initiate a dead code elimination pass in the optimizing compiler.
Change-Id: Ie9db5d8e2c2c30e34145a0f7d2386b8ec58cfc4e
Diffstat (limited to 'compiler/optimizing/nodes.h')
| -rw-r--r-- | compiler/optimizing/nodes.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index eebd64bbfc..9741f717fe 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -513,6 +513,11 @@ class SideEffects : public ValueObject { return SideEffects(((1 << count) - 1) << kFlagChangesCount); } + bool HasSideEffects() const { + size_t all_bits_set = (1 << kFlagChangesCount) - 1; + return (flags_ & all_bits_set) != 0; + } + private: static constexpr int kFlagChangesSomething = 0; static constexpr int kFlagChangesCount = kFlagChangesSomething + 1; @@ -564,6 +569,7 @@ class HInstruction : public ArenaObject { virtual bool NeedsEnvironment() const { return false; } virtual bool IsControlFlow() const { return false; } + bool HasSideEffects() const { return side_effects_.HasSideEffects(); } void AddUseAt(HInstruction* user, size_t index) { uses_ = new (block_->GetGraph()->GetArena()) HUseListNode<HInstruction>(user, index, uses_); |