From 802cc04458927f35d7cb18697d6f75ef6f1db205 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 16 Aug 2023 15:13:09 -0700 Subject: [PATCH] Revert "[JIT] ARM64 - Temporary fix for `ldp`/`stp` optimizations (#90534)" This reverts commit 99a60c6a5c6671f92c18a032c6dff033a3a2adb7. --- src/coreclr/jit/emitarm64.cpp | 9 --- .../JitBlue/Runtime_85765/Runtime_85765.cs | 63 ------------------- .../Runtime_85765/Runtime_85765.csproj | 8 --- 3 files changed, 80 deletions(-) delete mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.cs delete mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.csproj diff --git a/src/coreclr/jit/emitarm64.cpp b/src/coreclr/jit/emitarm64.cpp index f01ad548d2ee04..b4e81322e2a696 100644 --- a/src/coreclr/jit/emitarm64.cpp +++ b/src/coreclr/jit/emitarm64.cpp @@ -16615,15 +16615,6 @@ emitter::RegisterOrder emitter::IsOptimizableLdrStrWithPair( emitAttr prevSize = emitLastIns->idOpSize(); ssize_t prevImm = emitGetInsSC(emitLastIns); - // If we have this format, the 'imm' and/or 'prevImm' are not scaled(encoded), - // therefore we cannot proceed. - // TODO: In this context, 'imm' and 'prevImm' are assumed to be scaled(encoded). - // They should never be scaled(encoded) until its about to be written to the buffer. - if (fmt == IF_LS_2C || lastInsFmt == IF_LS_2C) - { - return eRO_none; - } - // Signed, *raw* immediate value fits in 7 bits, so for LDP/ STP the raw value is from -64 to +63. // For LDR/ STR, there are 9 bits, so we need to limit the range explicitly in software. if ((imm < -64) || (imm > 63) || (prevImm < -64) || (prevImm > 63)) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.cs b/src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.cs deleted file mode 100644 index f04eed1b7981c8..00000000000000 --- a/src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; -using Xunit; - -public class Runtime_85765 -{ - public struct S0 - { - public S0(bool f1): this() - { - } - } - - public struct S1 - { - public byte F0; - public bool F1; - public bool F2; - } - - [Fact] - public static void Test() - { - S1 vr2 = M4(); - vr2.F2 |= vr2.F1; - Assert.False(Consume(vr2.F2)); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public static S1 M4() - { - S1 var1 = default(S1); - var vr0 = new S0(false); - return var1; - } - - [MethodImpl(MethodImplOptions.NoInlining)] - private static bool Consume(bool value) - { - return value; - } - - // ------ - - [Fact] - public static void Test2() - { - byte* bytes = stackalloc byte[1024]; - bytes[0x1A] = 1; - bytes[0x1B] = 2; - int sum = Foo(bytes); - Assert.True(sum == 515); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public static int Foo(byte* b) - { - return Unsafe.ReadUnaligned(ref b[0x1A]) + Unsafe.ReadUnaligned(ref b[0x1B]); - } -} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.csproj deleted file mode 100644 index de6d5e08882e86..00000000000000 --- a/src/tests/JIT/Regression/JitBlue/Runtime_85765/Runtime_85765.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - True - - - - -