summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes_vector.h
diff options
context:
space:
mode:
author Artem Serov <artem.serov@linaro.org> 2019-12-04 21:10:23 +0000
committer Ulyana Trafimovich <skvadrik@google.com> 2021-02-04 06:16:33 +0000
commit8ba4de1a5684686447a578bdc425321fd3bccca6 (patch)
tree20c24450b24950266ccc235306e3ad2109c57497 /compiler/optimizing/nodes_vector.h
parent32bf6d39bc020cacfc655ce60630f4a0da3b45cf (diff)
ART: Implement predicated SIMD vectorization.
This CL brings support for predicated execution for auto-vectorizer and implements arm64 SVE vector backend. This version passes all the VIXL simulator-runnable tests in SVE mode with checker off (as all VecOp CHECKs need to be adjusted for an extra input) and all tests in NEON mode. Test: art SIMD tests on VIXL simulator. Test: art tests on FVP (steps in test/README.arm_fvp.md) Change-Id: Ib78bde31a15e6713d875d6668ad4458f5519605f
Diffstat (limited to 'compiler/optimizing/nodes_vector.h')
-rw-r--r--compiler/optimizing/nodes_vector.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes_vector.h b/compiler/optimizing/nodes_vector.h
index 9c6b422c87..a2cd86dc33 100644
--- a/compiler/optimizing/nodes_vector.h
+++ b/compiler/optimizing/nodes_vector.h
@@ -145,6 +145,15 @@ class HVecOperation : public HVariableInputSizeInstruction {
return pred_input->AsVecPredSetOperation();
}
+ // Returns whether two vector operations are predicated by the same vector predicate
+ // with the same predication type.
+ static bool HaveSamePredicate(HVecOperation* instr0, HVecOperation* instr1) {
+ HVecPredSetOperation* instr0_predicate = instr0->GetGoverningPredicate();
+ HVecOperation::PredicationKind instr0_predicate_kind = instr0->GetPredicationKind();
+ return instr1->GetGoverningPredicate() == instr0_predicate &&
+ instr1->GetPredicationKind() == instr0_predicate_kind;
+ }
+
// Returns the number of elements packed in a vector.
size_t GetVectorLength() const {
return vector_length_;