Revert "Revert "Revert "Change condition to opposite if lhs is constant"""
Fails two checker tests:
458-checker-instruction-simplification
537-checker-jump-over-jump
This reverts commit 884e54c8a45e49b58cb1127c8ed890f79f382601.
Change-Id: I22553e4e77662736b8b453d911a2f4e601f3a27e
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index cfb7179..c06d164 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -2706,8 +2706,6 @@
bool IsGtBias() const { return bias_ == ComparisonBias::kGtBias; }
- bool IsLtBias() const { return bias_ == ComparisonBias::kLtBias; }
-
void SetBias(ComparisonBias bias) { bias_ = bias; }
bool InstructionDataEquals(HInstruction* other) const OVERRIDE {
@@ -2717,23 +2715,13 @@
bool IsFPConditionTrueIfNaN() const {
DCHECK(Primitive::IsFloatingPointType(InputAt(0)->GetType()));
IfCondition if_cond = GetCondition();
- if (if_cond == kCondNE) {
- return true;
- } else if (if_cond == kCondEQ) {
- return false;
- }
- return ((if_cond == kCondGT) || (if_cond == kCondGE)) && IsGtBias();
+ return IsGtBias() ? ((if_cond == kCondGT) || (if_cond == kCondGE)) : (if_cond == kCondNE);
}
bool IsFPConditionFalseIfNaN() const {
DCHECK(Primitive::IsFloatingPointType(InputAt(0)->GetType()));
IfCondition if_cond = GetCondition();
- if (if_cond == kCondEQ) {
- return true;
- } else if (if_cond == kCondNE) {
- return false;
- }
- return ((if_cond == kCondLT) || (if_cond == kCondLE)) && IsGtBias();
+ return IsGtBias() ? ((if_cond == kCondLT) || (if_cond == kCondLE)) : (if_cond == kCondEQ);
}
private: