Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
a78211be
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
a78211be
编写于
6月 17, 2022
作者:
J
Joni Aromaa
提交者:
GitHub
6月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Unpin locals, attempt 2 (#70655)
Contributes to #40553
上级
5fc5c68d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
55 addition
and
30 deletion
+55
-30
src/coreclr/jit/compiler.h
src/coreclr/jit/compiler.h
+2
-0
src/coreclr/jit/gentree.h
src/coreclr/jit/gentree.h
+5
-0
src/coreclr/jit/lclvars.cpp
src/coreclr/jit/lclvars.cpp
+48
-30
未找到文件。
src/coreclr/jit/compiler.h
浏览文件 @
a78211be
...
...
@@ -614,6 +614,8 @@ public:
unsigned
char
lvSingleDefDisqualifyReason
=
'H'
;
#endif
unsigned
char
lvAllDefsAreNoGc
:
1
;
// For pinned locals: true if all defs of this local are no-gc
#if FEATURE_MULTIREG_ARGS
regNumber
lvRegNumForSlot
(
unsigned
slotNum
)
{
...
...
src/coreclr/jit/gentree.h
浏览文件 @
a78211be
...
...
@@ -1104,6 +1104,11 @@ public:
return
true
;
}
bool
IsNotGcDef
()
const
{
return
IsIntegralConst
(
0
)
||
IsLocalAddrExpr
();
}
// LIR flags
// These helper methods, along with the flag values they manipulate, are defined in lir.h
//
...
...
src/coreclr/jit/lclvars.cpp
浏览文件 @
a78211be
...
...
@@ -4234,49 +4234,57 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt,
/* Is this an assignment to a local variable? */
if
(
op1
->
gtOper
==
GT_LCL_VAR
&&
op2
->
gtType
!=
TYP_BOOL
)
if
(
op1
->
gtOper
==
GT_LCL_VAR
)
{
/* Only simple assignments allowed for booleans */
LclVarDsc
*
varDsc
=
lvaGetDesc
(
op1
->
AsLclVarCommon
());
if
(
tree
->
gtOper
!=
GT_ASG
)
if
(
varDsc
->
lvPinned
&&
varDsc
->
lvAllDefsAreNoGc
)
{
goto
NOT_BOOL
;
if
(
!
op2
->
IsNotGcDef
())
{
varDsc
->
lvAllDefsAreNoGc
=
false
;
}
}
/* Is the RHS clearly a boolean value? */
switch
(
op2
->
gtOper
)
if
(
op2
->
gtType
!=
TYP_BOOL
)
{
unsigned
lclNum
;
/* Only simple assignments allowed for booleans */
case
GT_CNS_INT
:
if
(
tree
->
gtOper
!=
GT_ASG
)
{
goto
NOT_BOOL
;
}
if
(
op2
->
AsIntCon
()
->
gtIconVal
==
0
)
{
break
;
}
if
(
op2
->
AsIntCon
()
->
gtIconVal
==
1
)
{
break
;
}
/* Is the RHS clearly a boolean value? */
// Not 0 or 1, fall through ....
FALLTHROUGH
;
switch
(
op2
->
gtOper
)
{
case
GT_CNS_INT
:
default:
if
(
op2
->
AsIntCon
()
->
gtIconVal
==
0
)
{
break
;
}
if
(
op2
->
AsIntCon
()
->
gtIconVal
==
1
)
{
break
;
}
if
(
op2
->
OperIsCompare
())
{
break
;
}
// Not 0 or 1, fall through ....
FALLTHROUGH
;
NOT_BOOL
:
default
:
lclNum
=
op1
->
AsLclVarCommon
()
->
GetLclNum
();
noway_assert
(
lclNum
<
lvaCount
);
if
(
op2
->
OperIsCompare
())
{
break
;
}
lvaTable
[
lclNum
].
lvIsBoolean
=
false
;
break
;
NOT_BOOL:
varDsc
->
lvIsBoolean
=
false
;
break
;
}
}
}
}
...
...
@@ -4331,7 +4339,8 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt,
{
if
(
lvaVarAddrExposed
(
lclNum
))
{
varDsc
->
lvIsBoolean
=
false
;
varDsc
->
lvIsBoolean
=
false
;
varDsc
->
lvAllDefsAreNoGc
=
false
;
}
if
(
tree
->
gtOper
==
GT_LCL_FLD
)
...
...
@@ -4803,6 +4812,8 @@ void Compiler::lvaComputeRefCounts(bool isRecompute, bool setSlotNumbers)
{
varDsc
->
lvSingleDef
=
varDsc
->
lvIsParam
;
varDsc
->
lvSingleDefRegCandidate
=
varDsc
->
lvIsParam
;
varDsc
->
lvAllDefsAreNoGc
=
(
varDsc
->
lvImplicitlyReferenced
==
false
);
}
}
...
...
@@ -4921,6 +4932,13 @@ void Compiler::lvaComputeRefCounts(bool isRecompute, bool setSlotNumbers)
varDsc
->
lvImplicitlyReferenced
=
1
;
}
}
if
(
varDsc
->
lvPinned
&&
varDsc
->
lvAllDefsAreNoGc
)
{
varDsc
->
lvPinned
=
0
;
JITDUMP
(
"V%02u was unpinned as all def candidates were local.
\n
"
,
lclNum
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录