Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
a8c0d32d
R
runtime
项目概览
dotNET Platform
/
runtime
11 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a8c0d32d
编写于
3月 09, 2023
作者:
J
Jakob Botsch Nielsen
提交者:
GitHub
3月 09, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JIT: Fix EQ/NE(relop/SETCC, 0) optimization (#83144)
Fix #83140
上级
3db965d1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
96 addition
and
1 deletion
+96
-1
src/coreclr/jit/lower.cpp
src/coreclr/jit/lower.cpp
+5
-1
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140.cs
...sts/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140.cs
+40
-0
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140.csproj
...JIT/Regression/JitBlue/Runtime_83140/Runtime_83140.csproj
+9
-0
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140_2.cs
...s/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140_2.cs
+33
-0
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140_2.csproj
...T/Regression/JitBlue/Runtime_83140/Runtime_83140_2.csproj
+9
-0
未找到文件。
src/coreclr/jit/lower.cpp
浏览文件 @
a8c0d32d
...
...
@@ -3267,7 +3267,7 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp)
#endif // defined(TARGET_XARCH) || defined(TARGET_ARM64)
// Optimize EQ/NE(relop/SETCC, 0) into (maybe reversed) cond.
if
(
op2
->
IsIntegralConst
(
0
)
&&
(
op1
->
OperIsCompare
()
||
op1
->
OperIs
(
GT_SETCC
)))
if
(
cmp
->
OperIs
(
GT_EQ
,
GT_NE
)
&&
op2
->
IsIntegralConst
(
0
)
&&
(
op1
->
OperIsCompare
()
||
op1
->
OperIs
(
GT_SETCC
)))
{
LIR
::
Use
use
;
if
(
BlockRange
().
TryGetUse
(
cmp
,
&
use
))
...
...
@@ -3278,6 +3278,10 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp)
assert
(
reversed
==
op1
);
}
// Relops and SETCC can be either TYP_INT or TYP_LONG typed, so we
// may need to retype it.
op1
->
gtType
=
cmp
->
TypeGet
();
GenTree
*
next
=
cmp
->
gtNext
;
use
.
ReplaceWith
(
op1
);
BlockRange
().
Remove
(
cmp
->
gtGetOp2
());
...
...
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140.cs
0 → 100644
浏览文件 @
a8c0d32d
// 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 v1.5 on 2023-03-07 17:55:15
// Run on X86 Windows
// Seed: 7526964204781879473
// Reduced from 425.4 KiB to 0.4 KiB in 00:12:20
// Debug: Prints 0 line(s)
// Release: Prints 1 line(s)
public
struct
S0
{
public
ulong
F1
;
}
public
class
C0
{
public
uint
F0
;
}
public
class
C1
{
public
S0
F1
;
}
public
class
Runtime_83140
{
public
static
C0
s_10
=
new
C0
();
public
static
C1
s_64
=
new
C1
();
public
static
int
Main
()
{
// We were optimizing GE(relop, 0) by reversing the relop, but the optimization is only valid for EQ/NE(relop, 0).
if
(
0
>
(
int
)(
s_10
.
F0
/
2699312582U
))
{
var
vr5
=
s_64
.
F1
.
F1
;
return
-
1
;
}
return
100
;
}
}
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140.csproj
0 → 100644
浏览文件 @
a8c0d32d
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
\ No newline at end of file
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140_2.cs
0 → 100644
浏览文件 @
a8c0d32d
// 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 v1.5 on 2023-03-08 14:45:20
// Run on Arm64 MacOS
// Seed: 4799288502595168691
// Reduced from 173.8 KiB to 0.3 KiB in 00:00:42
// Hits JIT assert in Release:
// Assertion failed 'genTypeSize(op1Type) == genTypeSize(op2Type)' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Generate code' (IL size 76; hash 0xade6b36b; FullOpts)
//
// File: /Users/runner/work/1/s/src/coreclr/jit/codegenarm64.cpp Line: 4521
//
public
class
C0
{
public
long
F0
;
public
uint
F1
;
public
sbyte
F2
;
}
public
class
Runtime_83140_2
{
public
static
C0
s_3
=
new
C0
();
public
static
int
Main
()
{
// A case where produced incorrectly typed IR when optimizing NE(relop, 0) into relop
if
((
s_3
.
F0
<
s_3
.
F2
)
&
((
s_3
.
F1
/
13548999118840769392U
L
)
<=
0
))
{
bool
vr1
=
0
!=
s_3
.
F0
++;
}
return
100
;
}
}
src/tests/JIT/Regression/JitBlue/Runtime_83140/Runtime_83140_2.csproj
0 → 100644
浏览文件 @
a8c0d32d
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录