summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_arm.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2015-11-23 19:49:34 +0000
committerVladimir Marko <vmarko@google.com>2015-12-23 09:59:07 +0000
commit5f7b58ea1adfc0639dd605b65f59198d3763f801 (patch)
tree04556e673cdd3967cc967ff79931eab49e523956 /compiler/optimizing/code_generator_arm.h
parent1201804d1813d7db0accead9721d67c40b3de564 (diff)
Rewrite HInstruction::Is/As<type>().
Make Is<type>() and As<type>() non-virtual for concrete instruction types, relying on GetKind(), and mark GetKind() as PURE to improve optimization opportunities. This reduces the number of relocations in libart-compiler.so's .rel.dyn section by ~4K, or ~44%, and in .data.rel.ro by ~18K, or ~65%. The file is 96KiB smaller for Nexus 5, including 8KiB reduction of the .text section. Unfortunately, the g++/clang++ __attribute__((pure)) is not strong enough to avoid duplicated virtual calls and we would need the C++ [[pure]] attribute proposed in n3744 instead. To work around this deficiency, we introduce an extra non-virtual indirection for GetKind(), so that the compiler can optimize common expressions such as instruction->IsAdd() || instruction->IsSub() or instruction->IsAdd() && instruction->AsAdd()->... which contain two virtual calls to GetKind() after inlining. Change-Id: I83787de0671a5cb9f5b0a5f4a536cef239d5b401
Diffstat (limited to 'compiler/optimizing/code_generator_arm.h')
-rw-r--r--compiler/optimizing/code_generator_arm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_arm.h b/compiler/optimizing/code_generator_arm.h
index 8193c2808c..b7c58e1248 100644
--- a/compiler/optimizing/code_generator_arm.h
+++ b/compiler/optimizing/code_generator_arm.h
@@ -170,6 +170,7 @@ class LocationsBuilderARM : public HGraphVisitor {
private:
void HandleInvoke(HInvoke* invoke);
void HandleBitwiseOperation(HBinaryOperation* operation, Opcode opcode);
+ void HandleCondition(HCondition* condition);
void HandleIntegerRotate(LocationSummary* locations);
void HandleLongRotate(LocationSummary* locations);
void HandleRotate(HRor* ror);
@@ -216,6 +217,7 @@ class InstructionCodeGeneratorARM : public HGraphVisitor {
void GenerateOrrConst(Register out, Register first, uint32_t value);
void GenerateEorConst(Register out, Register first, uint32_t value);
void HandleBitwiseOperation(HBinaryOperation* operation);
+ void HandleCondition(HCondition* condition);
void HandleIntegerRotate(LocationSummary* locations);
void HandleLongRotate(LocationSummary* locations);
void HandleRotate(HRor* ror);