ART: Simplify Ifs with BooleanNot condition
If statements with negated condition can be simplified by removing the
negation and swapping the true and false branches.
Change-Id: I197afbc79fb7344d73b7b85d3611e7ca2519717f
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 753c95b..863b0b9 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -526,6 +526,13 @@
predecessors_.Put(1, temp);
}
+ void SwapSuccessors() {
+ DCHECK_EQ(successors_.Size(), 2u);
+ HBasicBlock* temp = successors_.Get(0);
+ successors_.Put(0, successors_.Get(1));
+ successors_.Put(1, temp);
+ }
+
size_t GetPredecessorIndexOf(HBasicBlock* predecessor) {
for (size_t i = 0, e = predecessors_.Size(); i < e; ++i) {
if (predecessors_.Get(i) == predecessor) {