From: Pat Gavlin Date: Wed, 24 Aug 2016 19:58:25 +0000 (-0700) Subject: Handle multi-reg PUTARG_STK nodes. (dotnet/coreclr#6870) X-Git-Tag: submit/tizen/20210909.063632~11030^2~9584 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a25958ffc2989bdad180b31b763a2f75e45695d;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Handle multi-reg PUTARG_STK nodes. (dotnet/coreclr#6870) * Handle multi-reg PUTARG_STK nodes. When FEATURE_MULTIREG_ARGS is true, a GT_PUTARG_STK node may have a GT_LIST as a child if the child was originally a multi-reg argument. Handle this case in `GenTreeUseEdgeIterator`. Fixes dotnet/coreclr#6583. * Update the bug number for some ARM64 failures. These tests are now failing due to a differnt bug. Commit migrated from https://github.com/dotnet/coreclr/commit/4071333a89d6c9bf240b8291535fdf7acf708642 --- diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp index bc6c41a..01c383a 100644 --- a/src/coreclr/src/jit/gentree.cpp +++ b/src/coreclr/src/jit/gentree.cpp @@ -8446,11 +8446,17 @@ GenTree** GenTreeUseEdgeIterator::GetNextUseEdge() const } // Call, phi, and SIMD nodes are handled by MoveNext{Call,Phi,SIMD}UseEdge, repsectively. + // + // If FEATURE_MULTIREG_ARGS is enabled, so PUTARG_STK nodes also have special handling. case GT_CALL: case GT_PHI: #ifdef FEATURE_SIMD case GT_SIMD: #endif +#if FEATURE_MULTIREG_ARGS + case GT_PUTARG_STK: +#endif + break; case GT_INITBLK: @@ -8774,7 +8780,55 @@ void GenTreeUseEdgeIterator::MoveToNextSIMDUseEdge() } } } -#endif +#endif // FEATURE_SIMD + +#if FEATURE_MULTIREG_ARGS +void GenTreeUseEdgeIterator::MoveToNextPutArgStkUseEdge() +{ + assert(m_node->OperGet() == GT_PUTARG_STK); + + GenTreeUnOp* putArg = m_node->AsUnOp(); + + for (;;) + { + switch (m_state) + { + case 0: + if ((putArg->gtOp1->OperGet() != GT_LIST) || !m_expandMultiRegArgs) + { + m_state = 2; + m_edge = &putArg->gtOp1; + return; + } + + m_state = 1; + m_argList = putArg->gtOp1; + break; + + case 1: + if (m_argList == nullptr) + { + m_state = 2; + } + else + { + GenTreeArgList* argNode = m_argList->AsArgList(); + m_edge = &argNode->gtOp1; + m_argList = argNode->Rest(); + return; + } + break; + + default: + m_node = nullptr; + m_edge = nullptr; + m_argList = nullptr; + m_state = -1; + return; + } + } +} +#endif // FEATURE_MULTIREG_ARGS //------------------------------------------------------------------------ // GenTreeUseEdgeIterator::operator++: @@ -8807,6 +8861,12 @@ GenTreeUseEdgeIterator& GenTreeUseEdgeIterator::operator++() MoveToNextSIMDUseEdge(); } #endif +#if FEATURE_MULTIREG_ARGS + else if (op == GT_PUTARG_STK) + { + MoveToNextPutArgStkUseEdge(); + } +#endif else { m_edge = GetNextUseEdge(); diff --git a/src/coreclr/src/jit/gentree.h b/src/coreclr/src/jit/gentree.h index cb77fa8..d9b0c49 100644 --- a/src/coreclr/src/jit/gentree.h +++ b/src/coreclr/src/jit/gentree.h @@ -1916,6 +1916,9 @@ class GenTreeUseEdgeIterator final #ifdef FEATURE_SIMD void MoveToNextSIMDUseEdge(); #endif +#if FEATURE_MULTIREG_ARGS + void MoveToNextPutArgStkUseEdge(); +#endif public: GenTreeUseEdgeIterator(); diff --git a/src/coreclr/tests/arm64/Tests.lst b/src/coreclr/tests/arm64/Tests.lst index 08fe4c7..e0511aa 100644 --- a/src/coreclr/tests/arm64/Tests.lst +++ b/src/coreclr/tests/arm64/Tests.lst @@ -55528,7 +55528,7 @@ RelativePath=JIT\Performance\CodeQuality\Roslyn\CscBench\CscBench.cmd WorkingDir=JIT\Performance\CodeQuality\Roslyn\CscBench Expected=0 MaxAllowedDurationSeconds=600 -Categories=Pri0;EXPECTED_FAIL;ISSUE_6583;LONG_RUNNING +Categories=Pri0;EXPECTED_FAIL;ISSUE_6893;LONG_RUNNING HostStyle=0 [SciMark.cmd_8027] RelativePath=JIT\Performance\CodeQuality\SciMark\SciMark\SciMark.cmd @@ -67652,7 +67652,7 @@ RelativePath=managed\Compilation\Compilation\Compilation.cmd WorkingDir=managed\Compilation\Compilation Expected=0 MaxAllowedDurationSeconds=800 -Categories=Pri0;RT;EXPECTED_FAIL;ISSUE_6583;NATIVE_INTEROP;LONG_RUNNING +Categories=Pri0;RT;EXPECTED_FAIL;ISSUE_6893;NATIVE_INTEROP;LONG_RUNNING HostStyle=0 [generics.cmd_9787] RelativePath=readytorun\generics\generics.cmd