Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
f8066b33
R
runtime
项目概览
dotNET Platform
/
runtime
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
f8066b33
编写于
5月 24, 2021
作者:
K
Kunal Pathak
提交者:
GitHub
5月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GT_COPY source should be marked as consume during resolution (#53041)
上级
4a23f535
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
6 deletion
+52
-6
docs/design/coreclr/jit/lsra-detail.md
docs/design/coreclr/jit/lsra-detail.md
+3
-3
src/coreclr/jit/clrjit.natvis
src/coreclr/jit/clrjit.natvis
+38
-0
src/coreclr/jit/lsra.cpp
src/coreclr/jit/lsra.cpp
+11
-3
未找到文件。
docs/design/coreclr/jit/lsra-detail.md
浏览文件 @
f8066b33
...
...
@@ -170,11 +170,11 @@ There are four main phases to LSRA:
- For fork edges (the source block has multiple targets, but
each target has only that one source), any required
resolution is placed at the
target
.
resolution is placed at the
individual target(s)
.
- For join edges (a single target block has multiple sources,
but each source has only that one target), any required
resolution is placed at the
source
.
resolution is placed at the
individual source(s)
.
- Critical edges require more complicated handling, and may
require splitting of the edge for placement of resolution.
...
...
@@ -707,7 +707,7 @@ LinearScanAllocation(List<RefPosition> refPositions)
- Next, for the remaining variables, classify them as either:
- In different registers at one or more targets. These require that the edge
be split so that we can insert the move on the edge (this is the `diffResolutionSet`).
- In the same register at each target (this is the `sameResolutionSet`).
- In the same register at each target (this is the `sameResolutionSet`)
, but different from the end of this block
.
For these, we can insert a move at the end of this block, as long as they
don't write to any of the registers read by the `diffResolutionSet` as those
must remain live into the split block.
...
...
src/coreclr/jit/clrjit.natvis
浏览文件 @
f8066b33
...
...
@@ -57,6 +57,44 @@ The .NET Foundation licenses this file to you under the MIT license.
<Type
Name=
"LinearScan"
>
<DisplayString>
LinearScan
</DisplayString>
<Expand>
<Item
Name=
"inVarToRegMaps"
>
"InVarToRegMaps"
</Item>
<CustomListItems>
<Variable
Name=
"block"
InitialValue=
"this->compiler->fgFirstBB"
/>
<Variable
Name=
"bbLiveInMap"
InitialValue=
"block ? block->bbLiveIn[0] : 0"
/>
<Variable
Name=
"inVarMap"
InitialValue=
"block ? this->inVarToRegMaps[block->bbNum] : 0"
/>
<Variable
Name=
"varIndex"
InitialValue=
"0"
/>
<Loop
Condition=
"block"
>
<Item
Name=
"---BB{block->bbNum,2u}---"
>
block->bbNum,2u
</Item>
<Exec>
varIndex = 0
</Exec>
<Exec>
inVarMap = this->inVarToRegMaps[block->bbNum]
</Exec>
<Exec>
bbLiveInMap = block->bbLiveIn[0]
</Exec>
<Loop
Condition=
"bbLiveInMap != 0"
>
<Item
Name=
"V{this->localVarIntervals[varIndex]->varNum,2u}"
Condition=
"(bbLiveInMap & 1) != 0"
>
((regNumber)inVarMap[varIndex]),en
</Item>
<Exec>
varIndex++
</Exec>
<Exec>
bbLiveInMap = bbLiveInMap >> 1
</Exec>
</Loop>
<Exec>
block = block->bbNext
</Exec>
</Loop>
</CustomListItems>
<Item
Name=
"outVarToRegMaps"
>
"OutVarToRegMaps"
</Item>
<CustomListItems>
<Variable
Name=
"block"
InitialValue=
"this->compiler->fgFirstBB"
/>
<Variable
Name=
"bbLiveInMap"
InitialValue=
"block ? block->bbLiveIn[0] : 0"
/>
<Variable
Name=
"outVarMap"
InitialValue=
"block ? this->outVarToRegMaps[block->bbNum] : 0"
/>
<Variable
Name=
"varIndex"
InitialValue=
"0"
/>
<Loop
Condition=
"block"
>
<Item
Name=
"---BB{block->bbNum,2u}---"
>
block->bbNum,2u
</Item>
<Exec>
varIndex = 0
</Exec>
<Exec>
outVarMap = this->outVarToRegMaps[block->bbNum]
</Exec>
<Exec>
bbLiveInMap = block->bbLiveIn[0]
</Exec>
<Loop
Condition=
"bbLiveInMap != 0"
>
<Item
Name=
"V{this->localVarIntervals[varIndex]->varNum,2u}"
Condition=
"(bbLiveInMap & 1) != 0"
>
((regNumber)outVarMap[varIndex]),en
</Item>
<Exec>
varIndex++
</Exec>
<Exec>
bbLiveInMap = bbLiveInMap >> 1
</Exec>
</Loop>
<Exec>
block = block->bbNext
</Exec>
</Loop>
</CustomListItems>
<Item
Name=
"AvailableRegs mask"
>
this-
>
m_AvailableRegs
</Item>
<CustomListItems>
<Variable
Name=
"reg"
InitialValue=
"this->m_AvailableRegs"
/>
...
...
src/coreclr/jit/lsra.cpp
浏览文件 @
f8066b33
...
...
@@ -7589,6 +7589,14 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block)
assert
(
varTypeIsIntegralOrI
(
op1
)
&&
varTypeIsIntegralOrI
(
op2
));
consumedRegs
|=
genRegMask
(
op1
->
GetRegNum
());
consumedRegs
|=
genRegMask
(
op2
->
GetRegNum
());
// Special handling for GT_COPY to not resolve into the source
// of switch's operand.
if
(
op1
->
OperIs
(
GT_COPY
))
{
GenTree
*
srcOp1
=
op1
->
gtGetOp1
();
consumedRegs
|=
genRegMask
(
srcOp1
->
GetRegNum
());
}
}
#ifdef TARGET_ARM64
...
...
@@ -7717,7 +7725,7 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block)
//
// Another way to achieve similar resolution for vars live only at split edges is by removing them
// from consideration up-front but it requires that we traverse those edges anyway to account for
// the registers that must not
e
be overwritten.
// the registers that must not be overwritten.
if
(
liveOnlyAtSplitEdge
&&
maybeSameLivePaths
)
{
sameToReg
=
REG_NA
;
...
...
@@ -9578,7 +9586,7 @@ void LinearScan::dumpLsraAllocationEvent(
// Conflicting def/use
case
LSRA_EVENT_DEFUSE_CONFLICT
:
dumpRefPositionShort
(
activeRefPosition
,
currentBlock
);
printf
(
"DUconflict "
);
printf
(
"DUconflict
"
);
dumpRegRecords
();
break
;
case
LSRA_EVENT_DEFUSE_CASE1
:
...
...
@@ -10056,7 +10064,7 @@ void LinearScan::dumpNewBlock(BasicBlock* currentBlock, LsraLocation location)
if
(
activeRefPosition
->
refType
==
RefTypeDummyDef
)
{
dumpEmptyRefPosition
();
printf
(
"DDefs "
);
printf
(
"DDefs
"
);
printf
(
regNameFormat
,
""
);
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录