summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/arm/CodegenCommon.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-01-31 17:01:43 -0800
committer buzbee <buzbee@google.com> 2012-02-02 15:56:41 -0800
commit5abfa3ea35781464df8fae60aaf03f48a295e965 (patch)
tree3db19d0ecfc1031f86d77964de636ec45d4ba690 /src/compiler/codegen/arm/CodegenCommon.cc
parent6c7d244058b74cdd61533968dd6cddd7003d2671 (diff)
Compiler tuning
Significant reduction in memory usage by the compiler. o Estimated sizes of growable lists to avoid waste o Changed basic block predecessor structure from a growable bitmap to a growable list. o Conditionalized code which produced disassembly strings. o Avoided generating some dataflow-related structures when compiling in dataflow-disabled mode. o Added memory usage statistics o Eliminated floating point usage as a barrier to disabling expensive dataflow analysis for very large init routines. o Because iterating through sparse bit maps is much less of a concern now, removed earlier hack that remembered runs of leading and trailing zeroes. Also, some general tuning. o Minor tweaks to register utilties o Speed up the assembly loop o Rewrite of the bit vector iterator Our previous worst-case method originally consumed 360 megabytes, but through earlier changes was whittled down to 113 megabytes. Now it consumes 12 (which so far appears to close to the highest compiler heap usage of anything I've seen). Post-wipe cold boot time is now less than 7 minutes. Installation time for our application test cases also shows a large gain - typically 25% to 40% speedup. Single-threaded host compilation of core.jar down to <3.0s, boot.oat builds in 17.2s. Next up: multi-threaded compilation. Change-Id: I493d0d584c4145a6deccdd9bff344473023deb46
Diffstat (limited to 'src/compiler/codegen/arm/CodegenCommon.cc')
-rw-r--r--src/compiler/codegen/arm/CodegenCommon.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/compiler/codegen/arm/CodegenCommon.cc b/src/compiler/codegen/arm/CodegenCommon.cc
index 26c17ef17b..c99573f11c 100644
--- a/src/compiler/codegen/arm/CodegenCommon.cc
+++ b/src/compiler/codegen/arm/CodegenCommon.cc
@@ -124,6 +124,10 @@ STATIC void setupResourceMasks(ArmLIR* lir)
flags = EncodingMap[lir->opcode].flags;
+ if (flags & NEEDS_FIXUP) {
+ lir->flags.pcRelFixup = true;
+ }
+
/* Set up the mask for resources that are updated */
if (flags & (IS_LOAD | IS_STORE)) {
/* Default to heap - will catch specialized classes later */
@@ -241,7 +245,7 @@ STATIC void setupResourceMasks(ArmLIR* lir)
*/
STATIC ArmLIR* newLIR0(CompilationUnit* cUnit, ArmOpcode opcode)
{
- ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true);
+ ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true, kAllocLIR);
DCHECK(isPseudoOpcode(opcode) || (EncodingMap[opcode].flags & NO_OPERAND));
insn->opcode = opcode;
setupResourceMasks(insn);
@@ -253,7 +257,7 @@ STATIC ArmLIR* newLIR0(CompilationUnit* cUnit, ArmOpcode opcode)
STATIC ArmLIR* newLIR1(CompilationUnit* cUnit, ArmOpcode opcode,
int dest)
{
- ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true);
+ ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true, kAllocLIR);
DCHECK(isPseudoOpcode(opcode) || (EncodingMap[opcode].flags & IS_UNARY_OP));
insn->opcode = opcode;
insn->operands[0] = dest;
@@ -266,7 +270,7 @@ STATIC ArmLIR* newLIR1(CompilationUnit* cUnit, ArmOpcode opcode,
STATIC ArmLIR* newLIR2(CompilationUnit* cUnit, ArmOpcode opcode,
int dest, int src1)
{
- ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true);
+ ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true, kAllocLIR);
DCHECK(isPseudoOpcode(opcode) ||
(EncodingMap[opcode].flags & IS_BINARY_OP));
insn->opcode = opcode;
@@ -281,7 +285,7 @@ STATIC ArmLIR* newLIR2(CompilationUnit* cUnit, ArmOpcode opcode,
STATIC ArmLIR* newLIR3(CompilationUnit* cUnit, ArmOpcode opcode,
int dest, int src1, int src2)
{
- ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true);
+ ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true, kAllocLIR);
DCHECK(isPseudoOpcode(opcode) ||
(EncodingMap[opcode].flags & IS_TERTIARY_OP))
<< (int)opcode << " "
@@ -301,7 +305,7 @@ STATIC ArmLIR* newLIR3(CompilationUnit* cUnit, ArmOpcode opcode,
STATIC ArmLIR* newLIR4(CompilationUnit* cUnit, ArmOpcode opcode,
int dest, int src1, int src2, int info)
{
- ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true);
+ ArmLIR* insn = (ArmLIR* ) oatNew(sizeof(ArmLIR), true, kAllocLIR);
DCHECK(isPseudoOpcode(opcode) ||
(EncodingMap[opcode].flags & IS_QUAD_OP));
insn->opcode = opcode;
@@ -361,7 +365,7 @@ STATIC ArmLIR* addWordData(CompilationUnit* cUnit, LIR* *constantListP,
{
/* Add the constant to the literal pool */
if (constantListP) {
- ArmLIR* newValue = (ArmLIR* ) oatNew(sizeof(ArmLIR), true);
+ ArmLIR* newValue = (ArmLIR* ) oatNew(sizeof(ArmLIR), true, kAllocData);
newValue->operands[0] = value;
newValue->generic.next = *constantListP;
*constantListP = (LIR*) newValue;