diff options
author | 2023-04-25 16:40:06 +0000 | |
---|---|---|
committer | 2023-04-27 10:53:55 +0000 | |
commit | cde6497d286337de2ed21c71c85157e2745b742b (patch) | |
tree | 087d790efb6987f5aab1da7cd91b89bedcdc5725 /compiler/optimizing/nodes_shared.h | |
parent | 79dc217688a774fc532584f6551a0aec8b45bc4a (diff) |
Optimizing: Add `HInstruction::As##type()`.
After the old implementation was renamed in
https://android-review.googlesource.com/2526708 ,
we introduce a new function with the old name but new
behavior, just `DCHECK()`-ing the instruction kind before
casting down the pointer. We change appropriate calls from
`As##type##OrNull()` to `As##type()` to avoid unncessary
run-time checks and reduce the size of libart-compiler.so.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 181943478
Change-Id: I025681612a77ca2157fed4886ca47f2053975d4e
Diffstat (limited to 'compiler/optimizing/nodes_shared.h')
-rw-r--r-- | compiler/optimizing/nodes_shared.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/optimizing/nodes_shared.h b/compiler/optimizing/nodes_shared.h index b91cc3e5fd..27e610328f 100644 --- a/compiler/optimizing/nodes_shared.h +++ b/compiler/optimizing/nodes_shared.h @@ -47,8 +47,7 @@ class HMultiplyAccumulate final : public HExpression<3> { bool CanBeMoved() const override { return true; } bool InstructionDataEquals(const HInstruction* other) const override { - // TODO: Remove "OrNull". - return op_kind_ == other->AsMultiplyAccumulateOrNull()->op_kind_; + return op_kind_ == other->AsMultiplyAccumulate()->op_kind_; } InstructionKind GetOpKind() const { return op_kind_; } @@ -216,8 +215,7 @@ class HDataProcWithShifterOp final : public HExpression<2> { bool IsClonable() const override { return true; } bool CanBeMoved() const override { return true; } bool InstructionDataEquals(const HInstruction* other_instr) const override { - // TODO: Remove "OrNull". - const HDataProcWithShifterOp* other = other_instr->AsDataProcWithShifterOpOrNull(); + const HDataProcWithShifterOp* other = other_instr->AsDataProcWithShifterOp(); return instr_kind_ == other->instr_kind_ && op_kind_ == other->op_kind_ && shift_amount_ == other->shift_amount_; |