From 078fa459fee2d5f26a94fbbe5b8f4feeafb4afb2 Mon Sep 17 00:00:00 2001 From: buzbee Date: Mon, 3 Dec 2012 15:51:33 -0800 Subject: Quick compiler: improve ClobberSReg comments Issue 6501474 Improve the comments describing the usage of ClobberSReg(). Also, desk-checked all current uses of ClobberSReg() to make sure they are appropriate. No code changes - only comments. Change-Id: Ife8419a7e2c2e51b258df7709a7d903d1fd93a44 --- src/compiler/codegen/ralloc_util.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/compiler/codegen/ralloc_util.cc') diff --git a/src/compiler/codegen/ralloc_util.cc b/src/compiler/codegen/ralloc_util.cc index 999c6527e9..1a3a4137d8 100644 --- a/src/compiler/codegen/ralloc_util.cc +++ b/src/compiler/codegen/ralloc_util.cc @@ -124,7 +124,17 @@ static void ClobberSRegBody(RegisterInfo* p, int num_regs, int s_reg) } } -/* Clobber any temp associated with an s_reg. Could be in either class */ +/* + * Break the association between a Dalvik vreg and a physical temp register of either register + * class. + * TODO: Ideally, the public version of this code should not exist. Besides its local usage + * in the register utilities, is is also used by code gen routines to work around a deficiency in + * local register allocation, which fails to distinguish between the "in" and "out" identities + * of Dalvik vregs. This can result in useless register copies when the same Dalvik vreg + * is used both as the source and destination register of an operation in which the type + * changes (for example: INT_TO_FLOAT v1, v1). Revisit when improved register allocation is + * addressed. + */ void ClobberSReg(CompilationUnit* cu, int s_reg) { #ifndef NDEBUG -- cgit v1.2.3-59-g8ed1b