[RyuJIT/armel] Make RefPosition arg regs fixed
authorHanjoung Lee <hanjoung.lee@samsung.com>
Tue, 25 Jul 2017 11:50:01 +0000 (20:50 +0900)
committerHanjoung Lee <hanjoung.lee@samsung.com>
Mon, 7 Aug 2017 02:37:01 +0000 (11:37 +0900)
Passing double arg regs via `r0:r1` or `r2:r3`,
each RefPosition's RegMask should have only one exact register
so the candidate register can be fixed.

e.g.)

```
<RefPosition #4099 @2625 RefTypeUse <Ivl:1237> BB35 regmask=[r0-r1] last>
<RefPosition #4100 @2625 RefTypeUse <Ivl:1238> BB35 regmask=[r0-r1] last>
```

to be:

```
<RefPosition #4099 @2625 RefTypeUse <Ivl:1237> BB35 regmask=[r0] last fixed>
<RefPosition #4100 @2625 RefTypeUse <Ivl:1238> BB35 regmask=[r1] last fixed>
```

Fix #12994

src/jit/lsra.cpp
src/jit/regset.cpp

index 9c4f7d8..691865d 100644 (file)
@@ -3985,6 +3985,15 @@ void LinearScan::buildRefPositionsForNode(GenTree*                  tree,
 #endif // DEBUG
 
             regMaskTP candidates = getUseCandidates(useNode);
+#ifdef ARM_SOFTFP
+            // If oper is GT_PUTARG_REG, set bits in useCandidates must be in sequential order.
+            if (useNode->OperGet() == GT_PUTARG_REG || useNode->OperGet() == GT_COPY)
+            {
+                regMaskTP candidate = genFindLowestReg(candidates);
+                useNode->gtLsraInfo.setSrcCandidates(this, candidates & ~candidate);
+                candidates = candidate;
+            }
+#endif // ARM_SOFTFP
             assert((candidates & allRegs(i->registerType)) != 0);
 
             // For non-localVar uses we record nothing, as nothing needs to be written back to the tree.
index 3f3acc0..6c1a98d 100644 (file)
@@ -1608,7 +1608,7 @@ void RegSet::rsSpillTree(regNumber reg, GenTreePtr tree, unsigned regIdx /* =0 *
 #endif // _TARGET_ARM_
     else
     {
-        assert(!varTypeIsMultiReg(tree));
+        assert(!varTypeIsMultiReg(tree) || (m_rsCompiler->opts.compUseSoftFP && treeType == TYP_LONG));
         tree->gtFlags &= ~GTF_SPILL;
     }
 #endif // !LEGACY_BACKEND