From 6cf6c027e70a43922e2bd5e6f62414f9951ab232 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 2 Jan 2025 09:58:57 +0000 Subject: Rename `AsAddOrSub()` - add suffix `OrNull`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I89d00710a4492fcca02dd12879702730c25779b3 --- compiler/optimizing/instruction_simplifier.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc index 703f6c77e8..69a880c242 100644 --- a/compiler/optimizing/instruction_simplifier.cc +++ b/compiler/optimizing/instruction_simplifier.cc @@ -3562,7 +3562,7 @@ bool InstructionSimplifierVisitor::TryHandleAssociativeAndCommutativeOperation( return true; } -static HBinaryOperation* AsAddOrSub(HInstruction* binop) { +static HBinaryOperation* AsAddOrSubOrNull(HInstruction* binop) { return (binop->IsAdd() || binop->IsSub()) ? binop->AsBinaryOperation() : nullptr; } @@ -3607,9 +3607,9 @@ bool InstructionSimplifierVisitor::TrySubtractionChainSimplification( return false; } - HBinaryOperation* y = (AsAddOrSub(left) != nullptr) + HBinaryOperation* y = (AsAddOrSubOrNull(left) != nullptr) ? left->AsBinaryOperation() - : AsAddOrSub(right); + : AsAddOrSubOrNull(right); // If y has more than one use, we do not perform the optimization because // it might increase code size (e.g. if the new constant is no longer // encodable as an immediate operand in the target ISA). -- cgit v1.2.3-59-g8ed1b