Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/coreclr/jit/redundantbranchopts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,15 @@ bool Compiler::optRelopTryInferWithOneEqualOperand(const VNFuncApp& domApp,

if ((ifTrueStatus == RelopResult::Unknown) && (ifFalseStatus == RelopResult::Unknown))
{
JITDUMP("Can't infer from both true and false branches - bail out.\n")
return false;
}

if ((ifTrueStatus == RelopResult::AlwaysTrue) && (ifFalseStatus == RelopResult::AlwaysTrue))
{
// If it doesn't depend on the dominating relop - bail out, someone else will fold
// this always-true condition.
JITDUMP("Always true from both branches - bail out.\n")
return false;
}

Expand Down
41 changes: 41 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_116159/Runtime_116159.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// Generated by Fuzzlyn v3.1 on 2025-05-30 09:55:02
// Run on Arm64 MacOS
// Seed: 17657029378323677877-vectort,vector64,vector128,armadvsimd,armadvsimdarm64,armaes,armarmbase,armarmbasearm64,armcrc32,armcrc32arm64,armdp,armrdm,armrdmarm64,armsha1,armsha256
// Reduced from 183.5 KiB to 0.6 KiB in 00:00:39
// Debug: Prints 0 line(s)
// Release: Prints 1 line(s)

using System;
using Xunit;

public class Runtime_116159
{
public static long[] s_3 = new long[]
{
0
};
public static int s_6;
public static ulong[] s_9;

[Fact]
public static void TestEntryPoint()
{
if (1 <= s_3[0])
{
s_9 = new ulong[]
{
0
};
}
else
{
if (long.MinValue > s_3[0])
{
throw new Exception();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
Loading