diff options
Diffstat (limited to 'compiler/optimizing/nodes_vector.h')
-rw-r--r-- | compiler/optimizing/nodes_vector.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/compiler/optimizing/nodes_vector.h b/compiler/optimizing/nodes_vector.h index 73f6c40a0d..223c06e1dc 100644 --- a/compiler/optimizing/nodes_vector.h +++ b/compiler/optimizing/nodes_vector.h @@ -142,7 +142,8 @@ class HVecOperation : public HVariableInputSizeInstruction { DCHECK(IsPredicated()); HInstruction* pred_input = InputAt(InputCount() - 1); DCHECK(pred_input->IsVecPredSetOperation()); - return pred_input->AsVecPredSetOperation(); + // TODO: Remove "OrNull". + return pred_input->AsVecPredSetOperationOrNull(); } // Returns whether two vector operations are predicated by the same vector predicate @@ -188,7 +189,8 @@ class HVecOperation : public HVariableInputSizeInstruction { // those fields in its own method *and* call all super methods. bool InstructionDataEquals(const HInstruction* other) const override { DCHECK(other->IsVecOperation()); - const HVecOperation* o = other->AsVecOperation(); + // TODO: Remove "OrNull". + const HVecOperation* o = other->AsVecOperationOrNull(); return GetVectorLength() == o->GetVectorLength() && GetPackedType() == o->GetPackedType(); } @@ -350,7 +352,8 @@ class HVecMemoryOperation : public HVecOperation { bool InstructionDataEquals(const HInstruction* other) const override { DCHECK(other->IsVecMemoryOperation()); - const HVecMemoryOperation* o = other->AsVecMemoryOperation(); + // TODO: Remove "OrNull". + const HVecMemoryOperation* o = other->AsVecMemoryOperationOrNull(); return HVecOperation::InstructionDataEquals(o) && GetAlignment() == o->GetAlignment(); } @@ -371,7 +374,8 @@ inline static bool HasConsistentPackedTypes(HInstruction* input, DataType::Type return input->GetType() == HVecOperation::kSIMDType; // carries SIMD } DCHECK(input->IsVecOperation()); - DataType::Type input_type = input->AsVecOperation()->GetPackedType(); + // TODO: Remove "OrNull". + DataType::Type input_type = input->AsVecOperationOrNull()->GetPackedType(); DCHECK_EQ(HVecOperation::ToUnsignedType(input_type) == HVecOperation::ToUnsignedType(type), HVecOperation::ToSignedType(input_type) == HVecOperation::ToSignedType(type)); return HVecOperation::ToSignedType(input_type) == HVecOperation::ToSignedType(type); @@ -465,7 +469,8 @@ class HVecReduce final : public HVecUnaryOperation { bool InstructionDataEquals(const HInstruction* other) const override { DCHECK(other->IsVecReduce()); - const HVecReduce* o = other->AsVecReduce(); + // TODO: Remove "OrNull". + const HVecReduce* o = other->AsVecReduceOrNull(); return HVecOperation::InstructionDataEquals(o) && GetReductionKind() == o->GetReductionKind(); } @@ -492,7 +497,10 @@ class HVecCnv final : public HVecUnaryOperation { DCHECK_NE(GetInputType(), GetResultType()); // actual convert } - DataType::Type GetInputType() const { return InputAt(0)->AsVecOperation()->GetPackedType(); } + DataType::Type GetInputType() const { + // TODO: Remove "OrNull". + return InputAt(0)->AsVecOperationOrNull()->GetPackedType(); + } DataType::Type GetResultType() const { return GetPackedType(); } bool CanBeMoved() const override { return true; } @@ -646,7 +654,8 @@ class HVecHalvingAdd final : public HVecBinaryOperation { bool InstructionDataEquals(const HInstruction* other) const override { DCHECK(other->IsVecHalvingAdd()); - const HVecHalvingAdd* o = other->AsVecHalvingAdd(); + // TODO: Remove "OrNull". + const HVecHalvingAdd* o = other->AsVecHalvingAddOrNull(); return HVecOperation::InstructionDataEquals(o) && IsRounded() == o->IsRounded(); } @@ -1036,7 +1045,8 @@ class HVecMultiplyAccumulate final : public HVecOperation { bool InstructionDataEquals(const HInstruction* other) const override { DCHECK(other->IsVecMultiplyAccumulate()); - const HVecMultiplyAccumulate* o = other->AsVecMultiplyAccumulate(); + // TODO: Remove "OrNull". + const HVecMultiplyAccumulate* o = other->AsVecMultiplyAccumulateOrNull(); return HVecOperation::InstructionDataEquals(o) && GetOpKind() == o->GetOpKind(); } @@ -1076,8 +1086,9 @@ class HVecSADAccumulate final : public HVecOperation { DCHECK(HasConsistentPackedTypes(accumulator, packed_type)); DCHECK(sad_left->IsVecOperation()); DCHECK(sad_right->IsVecOperation()); - DCHECK_EQ(ToSignedType(sad_left->AsVecOperation()->GetPackedType()), - ToSignedType(sad_right->AsVecOperation()->GetPackedType())); + // TODO: Remove "OrNull". + DCHECK_EQ(ToSignedType(sad_left->AsVecOperationOrNull()->GetPackedType()), + ToSignedType(sad_right->AsVecOperationOrNull()->GetPackedType())); SetRawInputAt(0, accumulator); SetRawInputAt(1, sad_left); SetRawInputAt(2, sad_right); @@ -1124,8 +1135,9 @@ class HVecDotProd final : public HVecOperation { DCHECK(DataType::IsIntegralType(packed_type)); DCHECK(left->IsVecOperation()); DCHECK(right->IsVecOperation()); - DCHECK_EQ(ToSignedType(left->AsVecOperation()->GetPackedType()), - ToSignedType(right->AsVecOperation()->GetPackedType())); + // TODO: Remove "OrNull". + DCHECK_EQ(ToSignedType(left->AsVecOperationOrNull()->GetPackedType()), + ToSignedType(right->AsVecOperationOrNull()->GetPackedType())); SetRawInputAt(0, accumulator); SetRawInputAt(1, left); SetRawInputAt(2, right); @@ -1179,7 +1191,8 @@ class HVecLoad final : public HVecMemoryOperation { bool InstructionDataEquals(const HInstruction* other) const override { DCHECK(other->IsVecLoad()); - const HVecLoad* o = other->AsVecLoad(); + // TODO: Remove "OrNull". + const HVecLoad* o = other->AsVecLoadOrNull(); return HVecMemoryOperation::InstructionDataEquals(o) && IsStringCharAt() == o->IsStringCharAt(); } @@ -1310,7 +1323,10 @@ class HVecPredSetAll final : public HVecPredSetOperation { // Having governing predicate doesn't make sense for set all TRUE/FALSE instruction. bool MustBePredicatedInPredicatedSIMDMode() override { return false; } - bool IsSetTrue() const { return InputAt(0)->AsIntConstant()->IsTrue(); } + bool IsSetTrue() const { + // TODO: Remove "OrNull". + return InputAt(0)->AsIntConstantOrNull()->IsTrue(); + } // Vector predicates are not kept alive across vector loop boundaries. bool CanBeMoved() const override { return false; } |