summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes_vector.h
diff options
context:
space:
mode:
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_;