From 3f8e02c3603cf48c7a656b2dd8781e11481fe34b Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Tue, 10 Apr 2018 11:55:00 -0700 Subject: 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 --- compiler/optimizing/nodes_vector.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/nodes_vector.h') 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; } -- cgit v1.2.3-59-g8ed1b