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-13 10:01:41 -0700
commit3f8e02c3603cf48c7a656b2dd8781e11481fe34b (patch)
tree04c1722c0477342dcc6b6d45329c799d99120e81 /compiler/optimizing/nodes_vector.h
parent8d2e70ae234d53f825f6876f5b5e75bdfe6729b5 (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 Change-Id: I8f8b2dbec35e906878b7f7ed62690c3234db4211
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 9b114eb1f7..1a484e1944 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;
}