diff options
author | 2015-04-20 10:14:42 +0100 | |
---|---|---|
committer | 2015-04-20 13:51:46 +0100 | |
commit | 2fa194bf16678e9e8f9e2653e47cb703dbbc9738 (patch) | |
tree | 6421285a359953e0290785d94987965e0660cb23 /compiler/optimizing/graph_checker.cc | |
parent | f5091eee4abe73c64959e53bda684bd689569643 (diff) |
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
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 6 |
1 files changed, 4 insertions, 2 deletions
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<int>(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.", |