From e9a72f6a1a84f4d9af0b07dd289b89e45ffb32d5 Mon Sep 17 00:00:00 2001 From: buzbee Date: Sun, 4 Sep 2011 17:59:07 -0700 Subject: Try/Catch analysis; various workarounds Fixed a couple of codegen bugs. Added a temporary workaround until SSA renaming problem is fixed. By enabling the "CompileDexLibCore" test in compiler_test.cc and disabling the jni_compiler, we appear to be successfully compiling 17,641 methods of libcore (note: of those, 4 exhibit the SSA problem). Also turned off most of the compiler logging, and disabled the fast path for invoke virtual (which seems to be broken). Change-Id: I0ecf460cba209f885209efbee62e9f80bffbf666 --- src/compiler/codegen/RallocUtil.cc | 40 ++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'src/compiler/codegen/RallocUtil.cc') diff --git a/src/compiler/codegen/RallocUtil.cc b/src/compiler/codegen/RallocUtil.cc index 6a9777ebe2..d6e0bbc7bc 100644 --- a/src/compiler/codegen/RallocUtil.cc +++ b/src/compiler/codegen/RallocUtil.cc @@ -1000,24 +1000,56 @@ extern RegLocation oatEvalLoc(CompilationUnit* cUnit, RegLocation loc, return loc; } +/* + * There's currently a problem in SSA renaming. So long as register promotion + * is disabled, a bad renaming will have no effect. Work around the problem + * here to make progress while the fix is being identified. + */ +#define SSA_WORKAROUND + extern RegLocation oatGetDest(CompilationUnit* cUnit, MIR* mir, int num) { - return cUnit->regLocation[mir->ssaRep->defs[num]]; + RegLocation res = cUnit->regLocation[mir->ssaRep->defs[num]]; +#ifdef SSA_WORKAROUND + res.wide = false; +#endif + assert(!res.wide); + return res; } extern RegLocation oatGetSrc(CompilationUnit* cUnit, MIR* mir, int num) { - return cUnit->regLocation[mir->ssaRep->uses[num]]; + RegLocation res = cUnit->regLocation[mir->ssaRep->uses[num]]; +#ifdef SSA_WORKAROUND + res.wide = false; +#endif + assert(!res.wide); + return res; +} +extern RegLocation oatGetRawSrc(CompilationUnit* cUnit, MIR* mir, int num) +{ + RegLocation res = cUnit->regLocation[mir->ssaRep->uses[num]]; + return res; } extern RegLocation oatGetDestWide(CompilationUnit* cUnit, MIR* mir, int low, int high) { - return oatGetDest(cUnit, mir, low); + RegLocation res = cUnit->regLocation[mir->ssaRep->defs[low]]; +#ifdef SSA_WORKAROUND + res.wide = true; +#endif + assert(res.wide); + return res; } extern RegLocation oatGetSrcWide(CompilationUnit* cUnit, MIR* mir, int low, int high) { - return oatGetSrc(cUnit, mir, low); + RegLocation res = cUnit->regLocation[mir->ssaRep->uses[low]]; +#ifdef SSA_WORKAROUND + res.wide = true; +#endif + assert(res.wide); + return res; } /* Kill the corresponding bit in the null-checked register list */ -- cgit v1.2.3-59-g8ed1b