From c0e77cbf0ba39c1d8e59d6abeadd40cabda61620 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 20 Jun 2024 07:15:41 +0000 Subject: Specify instruction format in `HInstructionBuilder`. Even in cases where constant propagation to switch statement should reduce the inlined `Instruction::VReg{A,B,C}()` to the version with a specific format, clang++ is failing to optimize this properly. And there are builder functions that handle a known instruction format which are not inlined, so they are ineligible even if clang++ did optimize this. This simple change reduces the read/execute section in arm64 `libart.so` by almost 35KiB as seen with readelf -l [...]/libart.so | grep -E 'R E' (0x71a350 -> 0x711820). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ia2d89fecef7fd8b8784fa7d6b0d2b8877501c629 --- compiler/optimizing/instruction_builder.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/optimizing/instruction_builder.h') diff --git a/compiler/optimizing/instruction_builder.h b/compiler/optimizing/instruction_builder.h index 5c165d7bf9..b3b5deae59 100644 --- a/compiler/optimizing/instruction_builder.h +++ b/compiler/optimizing/instruction_builder.h @@ -132,6 +132,9 @@ class HInstructionBuilder : public ValueObject { bool second_is_lit, bool is_div); + template + void BuildMove(uint32_t dest_reg, uint32_t src_reg); + void BuildReturn(const Instruction& instruction, DataType::Type type, uint32_t dex_pc); // Builds an instance field access node and returns whether the instruction is supported. -- cgit v1.2.3-59-g8ed1b