FP breakage workaround
This should get the x86 runtests passing again until I track down
the root cause. The bug is related to the invoke/move_result fusing,
but the problem remained after fixing the issue with x86 using a
different return register for floats. This CL disables the fusing for
x86.
Change-Id: Id2b2ebc5ebd4089fe3053d8f077dcadba3466de0
diff --git a/src/compiler/Dataflow.cc b/src/compiler/Dataflow.cc
index 8196ce9..e7998d1 100644
--- a/src/compiler/Dataflow.cc
+++ b/src/compiler/Dataflow.cc
@@ -1689,6 +1689,7 @@
mir = advanceMIR(cUnit, &tbb, mir, NULL, false);
while (mir != NULL) {
if ((mir->dalvikInsn.opcode == Instruction::MOVE_RESULT) ||
+ (mir->dalvikInsn.opcode == Instruction::MOVE_RESULT_OBJECT) ||
(mir->dalvikInsn.opcode == Instruction::MOVE_RESULT_WIDE)) {
break;
}
diff --git a/src/compiler/Ralloc.cc b/src/compiler/Ralloc.cc
index e1689a6..a3b3c50 100644
--- a/src/compiler/Ralloc.cc
+++ b/src/compiler/Ralloc.cc
@@ -81,12 +81,11 @@
}
// Try to find the next move result which might have an FP target
-SSARepresentation* findMoveResult(MIR* mir)
+SSARepresentation* findFPMoveResult(MIR* mir)
{
SSARepresentation* res = NULL;
for (; mir; mir = mir->next) {
if ((mir->dalvikInsn.opcode == Instruction::MOVE_RESULT) ||
- (mir->dalvikInsn.opcode == Instruction::MOVE_RESULT_OBJECT) ||
(mir->dalvikInsn.opcode == Instruction::MOVE_RESULT_WIDE)) {
res = mir->ssaRep;
break;
@@ -193,10 +192,10 @@
// Handle result type if floating point
if ((shorty[0] == 'F') || (shorty[0] == 'D')) {
// Find move-result that consumes this result
- SSARepresentation* tgtRep = findMoveResult(mir->next);
+ SSARepresentation* tgtRep = findFPMoveResult(mir->next);
// Might be in next basic block
if (!tgtRep) {
- tgtRep = findMoveResult(bb->fallThrough->firstMIRInsn);
+ tgtRep = findFPMoveResult(bb->fallThrough->firstMIRInsn);
}
// Result might not be used at all, so no move-result
if (tgtRep) {
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index e06cf3f..edf880b 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -159,10 +159,10 @@
if (info->result.location != kLocInvalid) {
// We have a following MOVE_RESULT - do it now.
if (info->result.wide) {
- RegLocation retLoc = oatGetReturnWide(cUnit, false);
+ RegLocation retLoc = oatGetReturnWide(cUnit, info->result.fp);
storeValueWide(cUnit, info->result, retLoc);
} else {
- RegLocation retLoc = oatGetReturn(cUnit, false);
+ RegLocation retLoc = oatGetReturn(cUnit, info->result.fp);
storeValue(cUnit, info->result, retLoc);
}
}
@@ -179,6 +179,9 @@
{
CallInfo* info = (CallInfo*)oatNew(cUnit, sizeof(CallInfo), true,
kAllocMisc);
+#if defined(TARGET_X86)
+ info->result.location = kLocInvalid;
+#else
MIR* moveResultMIR = oatFindMoveResult(cUnit, bb, mir);
if (moveResultMIR == NULL) {
info->result.location = kLocInvalid;
@@ -186,6 +189,7 @@
info->result = oatGetRawDest(cUnit, moveResultMIR);
moveResultMIR->dalvikInsn.opcode = Instruction::NOP;
}
+#endif
info->numArgWords = mir->ssaRep->numUses;
info->args = (info->numArgWords == 0) ? NULL : (RegLocation*)
oatNew(cUnit, sizeof(RegLocation) * info->numArgWords, false, kAllocMisc);