Skip to content

Commit a37889c

Browse files
AndyAyersMSCopilot
andauthored
JIT test: remove SimdLoadBetweenBCs from ElidedBoundsChecks (#129044)
Exception behavior of Vector128.Create from contiguous array indices changed in #128965 (no longer recognized as a single SIMD load with ArgumentOutOfRangeException). Fixes #129037. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent dc6cc9e commit a37889c

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

src/tests/JIT/opt/RangeChecks/ElidedBoundsChecks.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,6 @@ static int TwoArrays(int[] a, int[] b)
205205
return a[0] + b[0] + a[3] + b[1];
206206
}
207207

208-
[MethodImpl(MethodImplOptions.NoInlining)]
209-
static float SimdLoadBetweenBCs(float[] a)
210-
{
211-
// The contiguous Vector128.Create from a[1..4] is lowered to a single
212-
// SIMD load whose bounds check throws ArgumentOutOfRangeException, not
213-
// IndexOutOfRangeException. It must act as a barrier: if a[0]'s check
214-
// were strengthened to a[7] across it, a too-short array would observe
215-
// IndexOutOfRangeException instead of the ArgumentOutOfRangeException
216-
// the SIMD load is required to throw first.
217-
float x = a[0];
218-
Vector128<float> v = Vector128.Create(a[1], a[2], a[3], a[4]);
219-
return x + v.ToScalar() + a[7];
220-
}
221-
222208
[MethodImpl(MethodImplOptions.NoInlining)]
223209
static int UnsignedShiftBySignBit(int i)
224210
{
@@ -350,20 +336,6 @@ public static int TestEntryPoint()
350336
if (UnsignedShiftBySignBit(-1) != 1 || UnsignedShiftBySignBit(0) != 0)
351337
return 0;
352338

353-
// A SIMD load with a non-IOOB bounds check (ArgumentOutOfRangeException)
354-
// between two array checks must act as a barrier: a[0]'s check must not
355-
// be strengthened across it, otherwise a short array would observe
356-
// IndexOutOfRangeException instead of ArgumentOutOfRangeException.
357-
// The contiguous Vector128.Create -> single SIMD load recognition and the
358-
// bounds-check coalescing being validated here are RyuJIT-specific, so
359-
// only assert the exact exception type on CoreCLR.
360-
if (!TestLibrary.Utilities.IsMonoRuntime && Vector128.IsHardwareAccelerated)
361-
{
362-
if (SimdLoadBetweenBCs(new float[8]) != 0f)
363-
return 0;
364-
Assert.Throws<ArgumentOutOfRangeException>(() => SimdLoadBetweenBCs(new float[1]));
365-
}
366-
367339
return 100;
368340
}
369341
}

0 commit comments

Comments
 (0)