From 2fa194bf16678e9e8f9e2653e47cb703dbbc9738 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Mon, 20 Apr 2015 10:14:42 +0100 Subject: ART: Extend list of instructions accepted as boolean inputs Previous change allowed integer Phis as inputs of instructions expecting a boolean type. This list, however, was not exhaustive as binary operations And, Or and Xor are also valid inputs. This patch extends the list in SSAChecker. Change-Id: I5b5c9e7a17992cc4987e3a078ee23ea80028ecfc --- compiler/optimizing/graph_checker.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/graph_checker.cc') diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 3a56c6c68f..2216cecc2b 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -393,8 +393,10 @@ void SSAChecker::HandleBooleanInput(HInstruction* instruction, size_t input_inde static_cast(input_index), value)); } - } else if (input->GetType() == Primitive::kPrimInt && input->IsPhi()) { - // TODO: We need a data-flow analysis which determines if the Phi is boolean. + } else if (input->GetType() == Primitive::kPrimInt + && (input->IsPhi() || input->IsAnd() || input->IsOr() || input->IsXor())) { + // TODO: We need a data-flow analysis to determine if the Phi or + // binary operation is actually Boolean. Allow for now. } else if (input->GetType() != Primitive::kPrimBoolean) { AddError(StringPrintf( "%s instruction %d has a non-Boolean input %d whose type is: %s.", -- cgit v1.2.3-59-g8ed1b