diff options
Diffstat (limited to 'compiler/optimizing/instruction_simplifier_shared.cc')
-rw-r--r-- | compiler/optimizing/instruction_simplifier_shared.cc | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/compiler/optimizing/instruction_simplifier_shared.cc b/compiler/optimizing/instruction_simplifier_shared.cc index 3357e53737..34daae21ee 100644 --- a/compiler/optimizing/instruction_simplifier_shared.cc +++ b/compiler/optimizing/instruction_simplifier_shared.cc @@ -52,8 +52,7 @@ bool TrySimpleMultiplyAccumulatePatterns(HMul* mul, } else { DCHECK(input_binop->IsSub()); if (input_binop->GetRight()->IsConstant() && - // TODO: Remove "OrNull". - input_binop->GetRight()->AsConstantOrNull()->IsMinusOne()) { + input_binop->GetRight()->AsConstant()->IsMinusOne()) { // Interpret // a * (b - (-1)) // as @@ -61,8 +60,7 @@ bool TrySimpleMultiplyAccumulatePatterns(HMul* mul, input_b = input_binop->GetLeft(); op_kind = HInstruction::kAdd; } else if (input_binop->GetLeft()->IsConstant() && - // TODO: Remove "OrNull". - input_binop->GetLeft()->AsConstantOrNull()->IsOne()) { + input_binop->GetLeft()->AsConstant()->IsOne()) { // Interpret // a * (1 - b) // as @@ -124,8 +122,7 @@ bool TryCombineMultiplyAccumulate(HMul* mul, InstructionSet isa) { // whether all uses are on different control-flow paths (using dominance and // reverse-dominance information) and only perform the merge when they are. HInstruction* accumulator = nullptr; - // TODO: Remove "OrNull". - HBinaryOperation* binop = use->AsBinaryOperationOrNull(); + HBinaryOperation* binop = use->AsBinaryOperation(); HInstruction* binop_left = binop->GetLeft(); HInstruction* binop_right = binop->GetRight(); // Be careful after GVN. This should not happen since the `HMul` has only @@ -178,13 +175,11 @@ bool TryCombineMultiplyAccumulate(HMul* mul, InstructionSet isa) { HInstruction* left = mul->GetLeft(); HInstruction* right = mul->GetRight(); if ((right->IsAdd() || right->IsSub()) && - // TODO: Remove "OrNull". - TrySimpleMultiplyAccumulatePatterns(mul, right->AsBinaryOperationOrNull(), left)) { + TrySimpleMultiplyAccumulatePatterns(mul, right->AsBinaryOperation(), left)) { return true; } if ((left->IsAdd() || left->IsSub()) && - // TODO: Remove "OrNull". - TrySimpleMultiplyAccumulatePatterns(mul, left->AsBinaryOperationOrNull(), right)) { + TrySimpleMultiplyAccumulatePatterns(mul, left->AsBinaryOperation(), right)) { return true; } return false; @@ -219,8 +214,7 @@ bool TryMergeNegatedInput(HBinaryOperation* op) { // AND dst, src, tmp (respectively ORR, EOR) // with // BIC dst, src, mask (respectively ORN, EON) - // TODO: Remove "OrNull". - HInstruction* src = hnot->AsNotOrNull()->GetInput(); + HInstruction* src = hnot->AsNot()->GetInput(); HBitwiseNegatedRight* neg_op = new (hnot->GetBlock()->GetGraph()->GetAllocator()) HBitwiseNegatedRight(op->GetType(), op->GetKind(), hother, src, op->GetDexPc()); @@ -240,15 +234,13 @@ bool TryExtractArrayAccessAddress(HInstruction* access, HInstruction* index, size_t data_offset) { if (index->IsConstant() || - // TODO: Remove "OrNull". - (index->IsBoundsCheck() && index->AsBoundsCheckOrNull()->GetIndex()->IsConstant())) { + (index->IsBoundsCheck() && index->AsBoundsCheck()->GetIndex()->IsConstant())) { // When the index is a constant all the addressing can be fitted in the // memory access instruction, so do not split the access. return false; } if (access->IsArraySet() && - // TODO: Remove "OrNull". - access->AsArraySetOrNull()->GetValue()->GetType() == DataType::Type::kReference) { + access->AsArraySet()->GetValue()->GetType() == DataType::Type::kReference) { // The access may require a runtime call or the original array pointer. return false; } @@ -308,8 +300,7 @@ bool TryExtractVecArrayAccessAddress(HVecMemoryOperation* access, HInstruction* for (const HUseListNode<HInstruction*>& use : index->GetUses()) { HInstruction* user = use.GetUser(); if (user->IsVecMemoryOperation() && user != access) { - // TODO: Remove "OrNull". - HVecMemoryOperation* another_access = user->AsVecMemoryOperationOrNull(); + HVecMemoryOperation* another_access = user->AsVecMemoryOperation(); DataType::Type another_packed_type = another_access->GetPackedType(); uint32_t another_data_offset = mirror::Array::DataOffset( DataType::Size(another_packed_type)).Uint32Value(); @@ -319,13 +310,9 @@ bool TryExtractVecArrayAccessAddress(HVecMemoryOperation* access, HInstruction* break; } } else if (user->IsIntermediateAddressIndex()) { - // TODO: Remove "OrNull". - HIntermediateAddressIndex* another_access = user->AsIntermediateAddressIndexOrNull(); - // TODO: Remove "OrNull". - uint32_t another_data_offset = another_access->GetOffset()->AsIntConstantOrNull()->GetValue(); - // TODO: Remove "OrNull". - size_t another_component_shift = - another_access->GetShift()->AsIntConstantOrNull()->GetValue(); + HIntermediateAddressIndex* another_access = user->AsIntermediateAddressIndex(); + uint32_t another_data_offset = another_access->GetOffset()->AsIntConstant()->GetValue(); + size_t another_component_shift = another_access->GetShift()->AsIntConstant()->GetValue(); if (another_data_offset == data_offset && another_component_shift == component_shift) { is_extracting_beneficial = true; break; |