summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/ralloc_util.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-12-03 15:51:33 -0800
committer buzbee <buzbee@google.com> 2012-12-03 15:51:33 -0800
commit078fa459fee2d5f26a94fbbe5b8f4feeafb4afb2 (patch)
treed440d4e3e59ca177cd9ff406a77ce095670c58ef /src/compiler/codegen/ralloc_util.cc
parent609ba32ed9f1655383124f0c4b45c1b23e7aa2e2 (diff)
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
Diffstat (limited to 'src/compiler/codegen/ralloc_util.cc')
-rw-r--r--src/compiler/codegen/ralloc_util.cc12
1 files changed, 11 insertions, 1 deletions
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