summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2016-03-24 12:40:52 +0000
committer David Brazdil <dbrazdil@google.com> 2016-03-24 14:21:46 +0000
commit11edec7e7e8ac93f826d687b644fe700fab68993 (patch)
tree7a1a1bbbc7ae37a31f8301038f56f19b20be62f4 /compiler/optimizing/graph_checker.cc
parent843a65556616183a36792bbcc1632c6d8d0e78b2 (diff)
ART: Loosen a GraphChecker rule on Boolean inputs
GraphChecker tries to verify that Boolean inputs are properly typed. This is non-trivial in the presence of simplifying optimizations which capitalize on the fact that a Boolean value is internally represented as an integer. This patch removes the test from GraphChecker. Bug: 27625564 Change-Id: Ic61ea2193765b4578550538e965ca4f80fa4b287
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 528fe44669..e5c8c47579 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -840,17 +840,11 @@ void GraphChecker::HandleBooleanInput(HInstruction* instruction, size_t input_in
static_cast<int>(input_index),
value));
}
- } else if (input->GetType() == Primitive::kPrimInt
- && (input->IsPhi() ||
- input->IsAnd() ||
- input->IsOr() ||
- input->IsXor() ||
- input->IsSelect())) {
- // TODO: We need a data-flow analysis to determine if the Phi or Select or
- // binary operation is actually Boolean. Allow for now.
- } else if (input->GetType() != Primitive::kPrimBoolean) {
+ } else if (Primitive::PrimitiveKind(input->GetType()) != Primitive::kPrimInt) {
+ // TODO: We need a data-flow analysis to determine if an input like Phi,
+ // Select or a binary operation is actually Boolean. Allow for now.
AddError(StringPrintf(
- "%s instruction %d has a non-Boolean input %d whose type is: %s.",
+ "%s instruction %d has a non-integer input %d whose type is: %s.",
instruction->DebugName(),
instruction->GetId(),
static_cast<int>(input_index),