Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
878dc203
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,发现更多精彩内容 >>
未验证
提交
878dc203
编写于
6月 08, 2021
作者:
K
Kunal Pathak
提交者:
GitHub
6月 09, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Display LSRA stats in method summary (#53901)
* Lsrstats * jit format * use blocks iterator
上级
7df92fd4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
67 addition
and
11 deletion
+67
-11
src/coreclr/jit/codegencommon.cpp
src/coreclr/jit/codegencommon.cpp
+12
-4
src/coreclr/jit/compiler.h
src/coreclr/jit/compiler.h
+2
-1
src/coreclr/jit/jitconfigvalues.h
src/coreclr/jit/jitconfigvalues.h
+6
-4
src/coreclr/jit/lsra.cpp
src/coreclr/jit/lsra.cpp
+46
-2
src/coreclr/jit/lsra.h
src/coreclr/jit/lsra.h
+1
-0
未找到文件。
src/coreclr/jit/codegencommon.cpp
浏览文件 @
878dc203
...
...
@@ -2403,11 +2403,19 @@ void CodeGen::genEmitMachineCode()
if
(
compiler
->
opts
.
disAsm
||
verbose
)
{
printf
(
"
\n
; Total bytes of code %d, prolog size %d, PerfScore %.2f, instruction count %d, allocated bytes for "
"code %d (MethodHash=%08x) for "
"method %s
\n
"
,
"code %d"
,
codeSize
,
prologSize
,
compiler
->
info
.
compPerfScore
,
instrCount
,
GetEmitter
()
->
emitTotalHotCodeSize
+
GetEmitter
()
->
emitTotalColdCodeSize
,
compiler
->
info
.
compMethodHash
(),
compiler
->
info
.
compFullName
);
GetEmitter
()
->
emitTotalHotCodeSize
+
GetEmitter
()
->
emitTotalColdCodeSize
);
#if TRACK_LSRA_STATS
if
(
JitConfig
.
DisplayLsraStats
()
==
3
)
{
compiler
->
m_pLinearScan
->
dumpLsraStatsSummary
(
jitstdout
);
}
#endif // TRACK_LSRA_STATS
printf
(
" (MethodHash=%08x) for method %s
\n
"
,
compiler
->
info
.
compMethodHash
(),
compiler
->
info
.
compFullName
);
printf
(
"; ============================================================
\n\n
"
);
printf
(
""
);
// in our logic this causes a flush
}
...
...
src/coreclr/jit/compiler.h
浏览文件 @
878dc203
...
...
@@ -1131,7 +1131,8 @@ public:
virtual
void
recordVarLocationsAtStartOfBB
(
BasicBlock
*
bb
)
=
0
;
virtual
bool
willEnregisterLocalVars
()
const
=
0
;
#if TRACK_LSRA_STATS
virtual
void
dumpLsraStatsCsv
(
FILE
*
file
)
=
0
;
virtual
void
dumpLsraStatsCsv
(
FILE
*
file
)
=
0
;
virtual
void
dumpLsraStatsSummary
(
FILE
*
file
)
=
0
;
#endif // TRACK_LSRA_STATS
};
...
...
src/coreclr/jit/jitconfigvalues.h
浏览文件 @
878dc203
...
...
@@ -26,10 +26,12 @@ CONFIG_INTEGER(DiffableDasm, W("JitDiffableDasm"), 0) // Make the disas
CONFIG_INTEGER
(
JitDasmWithAddress
,
W
(
"JitDasmWithAddress"
),
0
)
// Print the process address next to each instruction of
// the disassembly
CONFIG_INTEGER
(
DisplayLoopHoistStats
,
W
(
"JitLoopHoistStats"
),
0
)
// Display JIT loop hoisting statistics
CONFIG_INTEGER
(
DisplayLsraStats
,
W
(
"JitLsraStats"
),
0
)
// Display JIT Linear Scan Register Allocator statistics
// if set to 1. If set to "2", display the stats in csv format.
// Recommended to use with JitStdOutFile flag.
CONFIG_STRING
(
JitLsraOrdering
,
W
(
"JitLsraOrdering"
))
// LSRA heuristics ordering
CONFIG_INTEGER
(
DisplayLsraStats
,
W
(
"JitLsraStats"
),
0
)
// Display JIT Linear Scan Register Allocator statistics
// If set to "1", display the stats in textual format.
// If set to "2", display the stats in csv format.
// If set to "3", display the stats in summarize format.
// Recommended to use with JitStdOutFile flag.
CONFIG_STRING
(
JitLsraOrdering
,
W
(
"JitLsraOrdering"
))
// LSRA heuristics ordering
CONFIG_INTEGER
(
DumpJittedMethods
,
W
(
"DumpJittedMethods"
),
0
)
// Prints all jitted methods to the console
CONFIG_INTEGER
(
EnablePCRelAddr
,
W
(
"JitEnablePCRelAddr"
),
1
)
// Whether absolute addr be encoded as PC-rel offset by
// RyuJIT where possible
...
...
src/coreclr/jit/lsra.cpp
浏览文件 @
878dc203
...
...
@@ -8621,7 +8621,8 @@ void LinearScan::dumpLsraStats(FILE* file)
fprintf
(
file
,
"----------
\n
"
);
#ifdef DEBUG
fprintf
(
file
,
"Register selection order: %S
\n
"
,
JitConfig
.
JitLsraOrdering
());
fprintf
(
file
,
"Register selection order: %S
\n
"
,
JitConfig
.
JitLsraOrdering
()
==
nullptr
?
W
(
"ABCDEFGHIJKLMNOPQ"
)
:
JitConfig
.
JitLsraOrdering
());
#endif
fprintf
(
file
,
"Total Tracked Vars: %d
\n
"
,
compiler
->
lvaTrackedCount
);
fprintf
(
file
,
"Total Reg Cand Vars: %d
\n
"
,
regCandidateVarCount
);
...
...
@@ -8640,6 +8641,7 @@ void LinearScan::dumpLsraStats(FILE* file)
bool
addedBlockHeader
=
false
;
bool
anyNonZeroStat
=
false
;
// Iterate for block 0
for
(
int
statIndex
=
0
;
statIndex
<
LsraStat
::
COUNT
;
statIndex
++
)
{
unsigned
lsraStat
=
blockInfo
[
0
].
stats
[
statIndex
];
...
...
@@ -8667,6 +8669,7 @@ void LinearScan::dumpLsraStats(FILE* file)
fprintf
(
file
,
"
\n
"
);
}
// Iterate for remaining blocks
for
(
BasicBlock
*
const
block
:
compiler
->
Blocks
())
{
if
(
block
->
bbNum
>
bbNumMaxBeforeResolution
)
...
...
@@ -8712,7 +8715,6 @@ void LinearScan::dumpLsraStats(FILE* file)
{
fprintf
(
file
,
"..........
\n
"
);
}
// TODO-review: I don't see a point of displaying Stats (SpillCount, etc.) if they are zero. Thoughts?
if
((
regSelectI
<
firstRegSelStat
)
||
(
sumStats
[
regSelectI
]
!=
0
))
{
// Print register selection stats
...
...
@@ -8780,6 +8782,48 @@ void LinearScan::dumpLsraStatsCsv(FILE* file)
}
fprintf
(
file
,
",%.2f
\n
"
,
compiler
->
info
.
compPerfScore
);
}
// -----------------------------------------------------------
// dumpLsraStatsSummary - dumps Lsra stats summary to given file
//
// Arguments:
// file - file to which stats are to be written.
//
void
LinearScan
::
dumpLsraStatsSummary
(
FILE
*
file
)
{
unsigned
sumStats
[
LsraStat
::
STAT_FREE
]
=
{
0
};
BasicBlock
::
weight_t
wtdStats
[
LsraStat
::
STAT_FREE
]
=
{
0.0
};
// Iterate for block 0
for
(
int
statIndex
=
0
;
statIndex
<
LsraStat
::
STAT_FREE
;
statIndex
++
)
{
unsigned
lsraStat
=
blockInfo
[
0
].
stats
[
statIndex
];
sumStats
[
statIndex
]
+=
lsraStat
;
wtdStats
[
statIndex
]
+=
(
lsraStat
*
blockInfo
[
0
].
weight
);
}
// Iterate for remaining blocks
for
(
BasicBlock
*
const
block
:
compiler
->
Blocks
())
{
if
(
block
->
bbNum
>
bbNumMaxBeforeResolution
)
{
continue
;
}
for
(
int
statIndex
=
0
;
statIndex
<
LsraStat
::
STAT_FREE
;
statIndex
++
)
{
unsigned
lsraStat
=
blockInfo
[
block
->
bbNum
].
stats
[
statIndex
];
sumStats
[
statIndex
]
+=
lsraStat
;
wtdStats
[
statIndex
]
+=
(
lsraStat
*
block
->
bbWeight
);
}
}
for
(
int
regSelectI
=
0
;
regSelectI
<
LsraStat
::
STAT_FREE
;
regSelectI
++
)
{
fprintf
(
file
,
", %s %u %sWt %f"
,
getStatName
(
regSelectI
),
sumStats
[
regSelectI
],
getStatName
(
regSelectI
),
wtdStats
[
regSelectI
]);
}
}
#endif // TRACK_LSRA_STATS
#ifdef DEBUG
...
...
src/coreclr/jit/lsra.h
浏览文件 @
878dc203
...
...
@@ -1455,6 +1455,7 @@ private:
public:
virtual
void
dumpLsraStatsCsv
(
FILE
*
file
);
virtual
void
dumpLsraStatsSummary
(
FILE
*
file
);
static
const
char
*
getStatName
(
unsigned
stat
);
#define INTRACK_STATS(x) x
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录