diff options
author | 2024-11-07 09:36:53 +0100 | |
---|---|---|
committer | 2024-11-08 09:29:38 +0000 | |
commit | f8ac417533d9ebee6d02ad84a1e6a6b056e6720d (patch) | |
tree | f0b9d5e9c2f7a3164205745055ed68eb328eb591 /compiler/optimizing/instruction_simplifier_shared.cc | |
parent | b506262278a1b556bea98fe47e919ed4e8bc7d2c (diff) |
Clean up after introducing `HRol`.
Clean up after
https://android-review.googlesource.com/3262277 .
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I11d3b2ffd2305a841fa44345b7d2bd09de21b42d
Diffstat (limited to 'compiler/optimizing/instruction_simplifier_shared.cc')
-rw-r--r-- | compiler/optimizing/instruction_simplifier_shared.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/optimizing/instruction_simplifier_shared.cc b/compiler/optimizing/instruction_simplifier_shared.cc index 7f575c0348..2215b93414 100644 --- a/compiler/optimizing/instruction_simplifier_shared.cc +++ b/compiler/optimizing/instruction_simplifier_shared.cc @@ -320,18 +320,15 @@ void UnfoldRotateLeft(HRol* rol) { HBasicBlock* block = rol->GetBlock(); HGraph* graph = block->GetGraph(); ArenaAllocator* allocator = graph->GetAllocator(); - HRor* ror; - + HInstruction* neg; if (rol->GetRight()->IsConstant()) { int32_t value = rol->GetRight()->AsIntConstant()->GetValue(); - HIntConstant* negated = graph->GetIntConstant(-value); - ror = new (allocator) HRor(rol->GetType(), rol->GetLeft(), negated); + neg = graph->GetIntConstant(-value); } else { - HNeg* neg = new (allocator) HNeg(DataType::Type::kInt32, rol->GetRight()); + neg = new (allocator) HNeg(DataType::Type::kInt32, rol->GetRight()); block->InsertInstructionBefore(neg, rol); - ror = new (allocator) HRor(rol->GetType(), rol->GetLeft(), neg); } - + HInstruction* ror = new (allocator) HRor(rol->GetType(), rol->GetLeft(), neg); block->ReplaceAndRemoveInstructionWith(rol, ror); } |