Skip to content

Commit 547b8e5

Browse files
committed
DelayFreeUses wrt CndSel node
wrap in TARGET_ARM64
1 parent 6af853d commit 547b8e5

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

src/coreclr/jit/lsra.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,9 @@ class LinearScan : public LinearScanInterface
19911991
GenTree* rmwNode = nullptr,
19921992
SingleTypeRegSet candidates = RBM_NONE,
19931993
RefPosition** useRefPosition = nullptr);
1994+
#ifdef TARGET_ARM64
1995+
int BuildDelayFreeUses(GenTree* node, GenTree* rmwNode1, GenTree* rmwNode2, SingleTypeRegSet candidates = RBM_NONE);
1996+
#endif
19941997
int BuildIndirUses(GenTreeIndir* indirTree, SingleTypeRegSet candidates = RBM_NONE);
19951998
int BuildAddrUses(GenTree* addr, SingleTypeRegSet candidates = RBM_NONE);
19961999

src/coreclr/jit/lsraarm64.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,9 +1979,9 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou
19791979

19801980
tgtPrefUse = BuildUse(emitOp1);
19811981
srcCount += 1;
1982-
srcCount += BuildDelayFreeUses(emitOp2, emitOp1);
1983-
srcCount += BuildDelayFreeUses(emitOp3, emitOp1);
1984-
srcCount += BuildDelayFreeUses(intrin.op3, emitOp1);
1982+
srcCount += BuildDelayFreeUses(emitOp2, emitOp1, intrinsicTree);
1983+
srcCount += BuildDelayFreeUses(emitOp3, emitOp1, intrinsicTree);
1984+
srcCount += BuildDelayFreeUses(intrin.op3, emitOp1, intrinsicTree);
19851985
}
19861986
else
19871987
{

src/coreclr/jit/lsrabuild.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,6 +3878,35 @@ int LinearScan::BuildDelayFreeUses(GenTree* node,
38783878
return srcCount;
38793879
}
38803880

3881+
#ifdef TARGET_ARM64
3882+
//------------------------------------------------------------------------
3883+
// BuildDelayFreeUses: Build Use RefPositions for an operand that might be contained,
3884+
// and which may need to be marked delayRegFree with respect to
3885+
// two RMW nodes.
3886+
//
3887+
// Arguments:
3888+
// node - The node of interest
3889+
// rmwNode1 - The node that has RMW semantics (if applicable)
3890+
// rmwNode2 - The node that has RMW semantics (if applicable)
3891+
// candidates - The set of candidates for the uses
3892+
//
3893+
// Return Value:
3894+
// The number of source registers used by the *parent* of this node.
3895+
//
3896+
int LinearScan::BuildDelayFreeUses(GenTree* node, GenTree* rmwNode1, GenTree* rmwNode2, SingleTypeRegSet candidates)
3897+
{
3898+
RefPosition* useRefPosition = nullptr;
3899+
int srcCount = BuildDelayFreeUses(node, rmwNode1, candidates, &useRefPosition);
3900+
3901+
if ((useRefPosition != nullptr) && !useRefPosition->delayRegFree)
3902+
{
3903+
AddDelayFreeUses(useRefPosition, rmwNode2);
3904+
}
3905+
3906+
return srcCount;
3907+
}
3908+
#endif // TARGET_ARM64
3909+
38813910
//------------------------------------------------------------------------
38823911
// BuildBinaryUses: Get the RefInfoListNodes for the operands of the
38833912
// given node, and build uses for them.

0 commit comments

Comments
 (0)