Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ec8157e

Browse files
authored
Merge pull request #6094 from mikedn/x86-uncontained-long
Allow uncontained GT_LONG nodes
2 parents e182458 + 6f8f215 commit ec8157e

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

src/jit/codegenxarch.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,6 +2736,13 @@ CodeGen::genCodeForTreeNode(GenTreePtr treeNode)
27362736
genProduceReg(treeNode);
27372737
break;
27382738

2739+
#if !defined(_TARGET_64BIT_)
2740+
case GT_LONG:
2741+
assert(!treeNode->isContained());
2742+
genConsumeRegs(treeNode);
2743+
break;
2744+
#endif
2745+
27392746
default:
27402747
{
27412748
#ifdef DEBUG

src/jit/gentree.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13248,6 +13248,14 @@ bool GenTree::isContained() const
1324813248
#endif
1324913249
return false;
1325013250

13251+
#if !defined(LEGACY_BACKEND) && !defined(_TARGET_64BIT_)
13252+
case GT_LONG:
13253+
// GT_LONG nodes are normally contained. The only exception is when the result
13254+
// of a TYP_LONG operation is not used and this can only happen if the GT_LONG
13255+
// is the last node in the statement (in linear order).
13256+
return gtNext != nullptr;
13257+
#endif
13258+
1325113259
case GT_CALL:
1325213260
// Note: if you hit this assert you are probably calling isContained()
1325313261
// before the LSRA phase has allocated physical register to the tree nodes

src/jit/lowerxarch.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,16 @@ void Lowering::TreeNodeInfoInit(GenTree* stmt)
247247
#if !defined(_TARGET_64BIT_)
248248

249249
case GT_LONG:
250-
// Passthrough
251-
info->srcCount = 0;
250+
if (tree->gtNext == nullptr)
251+
{
252+
// An uncontained GT_LONG node needs to consume its source operands
253+
info->srcCount = 2;
254+
}
255+
else
256+
{
257+
// Passthrough
258+
info->srcCount = 0;
259+
}
252260
info->dstCount = 0;
253261
break;
254262

0 commit comments

Comments
 (0)