summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes_vector.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2018-04-10 11:55:00 -0700
committer Aart Bik <ajcbik@google.com> 2018-04-16 10:11:16 -0700
commit1264d80ad53649796283053cb773aaaa521f638f (patch)
treebb3ed936ded9b4e62581b3860d433b5cc2aa1761 /compiler/optimizing/nodes_vector.h
parent724e9c8cdb75cd606fe583fd2502783046d62796 (diff)
Bug fix in SIMD result detection.
Rationale: Only 2-way phis are currently used in reductions to carry SIMD results. Note that this will go away when we introduce proper SIMD types. Note: So far I have not been able to make a small regression test for this. Any pointers on how to set up a catch phi? Test: test-art-host,target Bug: b/77725987 (cherry picked from commit 3f8e02c3603cf48c7a656b2dd8781e11481fe34b) Change-Id: I8147837ad9dbc66f371fd2e093df76dca399118d
Diffstat (limited to 'compiler/optimizing/nodes_vector.h')
-rw-r--r--compiler/optimizing/nodes_vector.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes_vector.h b/compiler/optimizing/nodes_vector.h
index 0d38d57375..d1eaf5c366 100644
--- a/compiler/optimizing/nodes_vector.h
+++ b/compiler/optimizing/nodes_vector.h
@@ -171,9 +171,12 @@ class HVecOperation : public HVariableInputSizeInstruction {
if (instruction->IsVecOperation()) {
return !instruction->IsVecExtractScalar(); // only scalar returning vec op
} else if (instruction->IsPhi()) {
+ // Vectorizer only uses Phis in reductions, so checking for a 2-way phi
+ // with a direct vector operand as second argument suffices.
return
instruction->GetType() == kSIMDType &&
- instruction->InputAt(1)->IsVecOperation(); // vectorizer does not go deeper
+ instruction->InputCount() == 2 &&
+ instruction->InputAt(1)->IsVecOperation();
}
return false;
}