From 3e42be3fbfa620112d115f67561df30d4b3f28d3 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Mon, 17 Apr 2023 15:28:09 -0700 Subject: [PATCH 1/3] Disable TLS field access for Arm --- src/coreclr/jit/helperexpansion.cpp | 7 +++++++ src/coreclr/vm/jitinterface.cpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/coreclr/jit/helperexpansion.cpp b/src/coreclr/jit/helperexpansion.cpp index 468cb381a4c441..89d2ebaa669963 100644 --- a/src/coreclr/jit/helperexpansion.cpp +++ b/src/coreclr/jit/helperexpansion.cpp @@ -460,6 +460,13 @@ bool Compiler::fgExpandThreadLocalAccessForCall(BasicBlock* block, Statement* st return false; } +#ifdef TARGET_ARM + // On Arm, Thread execution blocks are accessed using co-processor registers and instructions such + // as MRC and MCR are used to access them. We do not support them and so should never optimize the + // field access using TLS. + assert("Unsupported scenario of optimizing TLS access on Arm32"); +#endif + CORINFO_THREAD_STATIC_BLOCKS_INFO threadStaticBlocksInfo; info.compCompHnd->getThreadLocalStaticBlocksInfo(&threadStaticBlocksInfo); JITDUMP("getThreadLocalStaticBlocksInfo\n:"); diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 8c4e44ef7eac5d..32d338a0da6b44 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -1561,6 +1561,7 @@ void CEEInfo::getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken, pResult->helper = getSharedStaticsHelper(pField, pFieldMT); #ifdef HOST_WINDOWS +#ifndef TARGET_ARM bool canOptimizeHelper = (pResult->helper == CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR) || (pResult->helper == CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE); // For windows, we convert the TLS access to the optimized helper where we will store @@ -1571,6 +1572,7 @@ void CEEInfo::getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken, pResult->helper = CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED; } +#endif // !TARGET_ARM #endif // HOST_WINDOWS } else From 0316ac410e7f06eae62ba6a3b40c544bcc0b309a Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Mon, 17 Apr 2023 19:09:21 -0700 Subject: [PATCH 2/3] Update src/coreclr/jit/helperexpansion.cpp Co-authored-by: Bruce Forstall --- src/coreclr/jit/helperexpansion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/helperexpansion.cpp b/src/coreclr/jit/helperexpansion.cpp index 89d2ebaa669963..2f03327a8eeb39 100644 --- a/src/coreclr/jit/helperexpansion.cpp +++ b/src/coreclr/jit/helperexpansion.cpp @@ -464,7 +464,7 @@ bool Compiler::fgExpandThreadLocalAccessForCall(BasicBlock* block, Statement* st // On Arm, Thread execution blocks are accessed using co-processor registers and instructions such // as MRC and MCR are used to access them. We do not support them and so should never optimize the // field access using TLS. - assert("Unsupported scenario of optimizing TLS access on Arm32"); + assert(!"Unsupported scenario of optimizing TLS access on Arm32"); #endif CORINFO_THREAD_STATIC_BLOCKS_INFO threadStaticBlocksInfo; From 72de82eb0790c207056db61ef77c81b8f5e2461c Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Tue, 18 Apr 2023 11:25:20 -0700 Subject: [PATCH 3/3] Revert "Add issues.targets entries for four tests failing on Windows arm (#84943)" This reverts commit 80ce3b666823f2855b678307850e719a5f7366af. --- src/tests/issues.targets | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/tests/issues.targets b/src/tests/issues.targets index e9fd27ea8d9de1..83302d33aa9562 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -293,9 +293,6 @@ - - https://github.com/dotnet/runtime/issues/84818 - https://github.com/dotnet/runtime/issues/49184 @@ -512,21 +509,12 @@ https://github.com/dotnet/runtime/issues/66745 - - https://github.com/dotnet/runtime/issues/84818 - https://github.com/dotnet/runtime/issues/84750 https://github.com/dotnet/runtime/issues/84750 - - https://github.com/dotnet/runtime/issues/84818 - - - https://github.com/dotnet/runtime/issues/84818 - https://github.com/dotnet/runtime/issues/81241