From b29e4d1423028fab47db3be6e41e4b2a067bf100 Mon Sep 17 00:00:00 2001 From: buzbee Date: Mon, 26 Sep 2011 15:05:48 -0700 Subject: Misc codegen fixes related to register promotion The post-promotion world no longer guarantees that wide result pairs don't overlap with source operands. Also had to narrow a load-elimination optimization to apply only when using temp registers for Dalvik virtual registers. Change-Id: I2afbbec865d5a14d46e539cce4d8b3d0e4e8880b --- src/compiler/codegen/CodegenFactory.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/compiler/codegen/CodegenFactory.cc') diff --git a/src/compiler/codegen/CodegenFactory.cc b/src/compiler/codegen/CodegenFactory.cc index 108bc83521..55ed8af080 100644 --- a/src/compiler/codegen/CodegenFactory.cc +++ b/src/compiler/codegen/CodegenFactory.cc @@ -131,8 +131,9 @@ STATIC void storeValue(CompilationUnit* cUnit, RegLocation rlDest, rlDest = oatUpdateLoc(cUnit, rlDest); if (rlSrc.location == kLocPhysReg) { if (oatIsLive(cUnit, rlSrc.lowReg) || + oatIsPromoted(cUnit, rlSrc.lowReg) || (rlDest.location == kLocPhysReg)) { - // Src is live or Dest has assigned reg. + // Src is live/promoted or Dest has assigned reg. rlDest = oatEvalLoc(cUnit, rlDest, kAnyReg, false); genRegCopy(cUnit, rlDest.lowReg, rlSrc.lowReg); } else { @@ -192,8 +193,10 @@ STATIC void storeValueWide(CompilationUnit* cUnit, RegLocation rlDest, if (rlSrc.location == kLocPhysReg) { if (oatIsLive(cUnit, rlSrc.lowReg) || oatIsLive(cUnit, rlSrc.highReg) || + oatIsPromoted(cUnit, rlSrc.lowReg) || + oatIsPromoted(cUnit, rlSrc.highReg) || (rlDest.location == kLocPhysReg)) { - // Src is live or Dest has assigned reg. + // Src is live or promoted or Dest has assigned reg. rlDest = oatEvalLoc(cUnit, rlDest, kAnyReg, false); genRegCopyWide(cUnit, rlDest.lowReg, rlDest.highReg, rlSrc.lowReg, rlSrc.highReg); -- cgit v1.2.3-59-g8ed1b