Clean up art::HConstant predicates.
- Make the difference between arithmetic zero and zero-bit
pattern non ambiguous.
- Introduce Boolean predicates in art::HIntConstant for when
they are used as Booleans.
- Introduce aritmetic positive and negative zero predicates
for floating-point constants.
Bug: 27639313
Change-Id: Ia04ecc6f6aa7450136028c5362ed429760c883bd
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 98766a3..6a8c813 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -2402,10 +2402,10 @@
return replacement;
} else if (cond->IsIntConstant()) {
HIntConstant* int_const = cond->AsIntConstant();
- if (int_const->IsZero()) {
+ if (int_const->IsFalse()) {
return GetIntConstant(1);
} else {
- DCHECK(int_const->IsOne());
+ DCHECK(int_const->IsTrue()) << int_const->GetValue();
return GetIntConstant(0);
}
} else {