Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
db5c4337
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,发现更多精彩内容 >>
未验证
提交
db5c4337
编写于
9月 22, 2022
作者:
S
SingleAccretion
提交者:
GitHub
9月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete `GTF_VAR_CAST` (#74461)
It is unused. Tighten an assert in the ref counter.
上级
161464e3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
22 addition
and
78 deletion
+22
-78
src/coreclr/jit/compiler.cpp
src/coreclr/jit/compiler.cpp
+0
-4
src/coreclr/jit/gentree.cpp
src/coreclr/jit/gentree.cpp
+0
-6
src/coreclr/jit/gentree.h
src/coreclr/jit/gentree.h
+9
-12
src/coreclr/jit/lclvars.cpp
src/coreclr/jit/lclvars.cpp
+6
-43
src/coreclr/jit/morph.cpp
src/coreclr/jit/morph.cpp
+5
-5
src/coreclr/jit/morphblock.cpp
src/coreclr/jit/morphblock.cpp
+0
-1
src/coreclr/jit/optimizer.cpp
src/coreclr/jit/optimizer.cpp
+0
-6
src/coreclr/jit/valuenum.cpp
src/coreclr/jit/valuenum.cpp
+2
-1
未找到文件。
src/coreclr/jit/compiler.cpp
浏览文件 @
db5c4337
...
...
@@ -9218,10 +9218,6 @@ void cTreeFlags(Compiler* comp, GenTree* tree)
{
chars
+=
printf
(
"[VAR_USEASG]"
);
}
if
(
tree
->
gtFlags
&
GTF_VAR_CAST
)
{
chars
+=
printf
(
"[VAR_CAST]"
);
}
if
(
tree
->
gtFlags
&
GTF_VAR_ITERATOR
)
{
chars
+=
printf
(
"[VAR_ITERATOR]"
);
...
...
src/coreclr/jit/gentree.cpp
浏览文件 @
db5c4337
...
...
@@ -10442,12 +10442,6 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, _In_ _In_opt_
--msgLength;
break;
}
if (tree->gtFlags & GTF_VAR_CAST)
{
printf("C");
--msgLength;
break;
}
if (tree->gtFlags & GTF_VAR_CONTEXT)
{
printf("!");
...
...
src/coreclr/jit/gentree.h
浏览文件 @
db5c4337
...
...
@@ -468,11 +468,10 @@ enum GenTreeFlags : unsigned int
GTF_LIVENESS_MASK
=
GTF_VAR_DEF
|
GTF_VAR_USEASG
|
GTF_VAR_DEATH_MASK
,
GTF_VAR_CAST
=
0x01000000
,
// GT_LCL_VAR -- has been explicitly cast (variable node may not be type of local)
GTF_VAR_ITERATOR
=
0x00800000
,
// GT_LCL_VAR -- this is a iterator reference in the loop condition
GTF_VAR_CLONED
=
0x00400000
,
// GT_LCL_VAR -- this node has been cloned or is a clone
GTF_VAR_CONTEXT
=
0x00200000
,
// GT_LCL_VAR -- this node is part of a runtime lookup
GTF_VAR_FOLDED_IND
=
0x00100000
,
// GT_LCL_VAR -- this node was folded from *(typ*)&lclVar expression tree in fgMorphSmpOp()
GTF_VAR_ITERATOR
=
0x01000000
,
// GT_LCL_VAR -- this is a iterator reference in the loop condition
GTF_VAR_CLONED
=
0x00800000
,
// GT_LCL_VAR -- this node has been cloned or is a clone
GTF_VAR_CONTEXT
=
0x00400000
,
// GT_LCL_VAR -- this node is part of a runtime lookup
GTF_VAR_FOLDED_IND
=
0x00200000
,
// GT_LCL_VAR -- this node was folded from *(typ*)&lclVar expression tree in fgMorphSmpOp()
// where 'typ' is a small type and 'lclVar' corresponds to a normalized-on-store local variable.
// This flag identifies such nodes in order to make sure that fgDoNormalizeOnStore() is called
// on their parents in post-order morph.
...
...
@@ -2313,20 +2312,18 @@ public:
bool
IsReuseRegVal
()
const
{
// This can be extended to non-constant nodes, but not to local or indir nodes.
if
(
IsInvariant
()
&&
((
gtFlags
&
GTF_REUSE_REG_VAL
)
!=
0
))
{
return
true
;
}
return
false
;
return
OperIsConst
()
&&
((
gtFlags
&
GTF_REUSE_REG_VAL
)
!=
0
);
}
void
SetReuseRegVal
()
{
assert
(
IsInvarian
t
());
assert
(
OperIsCons
t
());
gtFlags
|=
GTF_REUSE_REG_VAL
;
}
void
ResetReuseRegVal
()
{
assert
(
IsInvarian
t
());
assert
(
OperIsCons
t
());
gtFlags
&=
~
GTF_REUSE_REG_VAL
;
}
...
...
src/coreclr/jit/lclvars.cpp
浏览文件 @
db5c4337
...
...
@@ -4452,7 +4452,7 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt,
#if FEATURE_PARTIAL_SIMD_CALLEE_SAVE
// TODO-CQ: If the varType needs partial callee save, conservatively do not enregister
// such variable. In future,
need to
enable enregisteration for such variables.
// such variable. In future,
we should
enable enregisteration for such variables.
if
(
!
varTypeNeedsPartialCalleeSave
(
varDsc
->
GetRegisterType
()))
#endif
{
...
...
@@ -4463,48 +4463,11 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt,
}
}
bool
allowStructs
=
false
;
#ifdef UNIX_AMD64_ABI
// On System V the type of the var could be a struct type.
allowStructs
=
varTypeIsStruct
(
varDsc
);
#endif // UNIX_AMD64_ABI
/* Variables must be used as the same type throughout the method */
noway_assert
(
varDsc
->
lvType
==
TYP_UNDEF
||
tree
->
gtType
==
TYP_UNKNOWN
||
allowStructs
||
genActualType
(
varDsc
->
TypeGet
())
==
genActualType
(
tree
->
gtType
)
||
(
tree
->
gtType
==
TYP_BYREF
&&
varDsc
->
TypeGet
()
==
TYP_I_IMPL
)
||
(
tree
->
gtType
==
TYP_I_IMPL
&&
varDsc
->
TypeGet
()
==
TYP_BYREF
)
||
(
tree
->
gtFlags
&
GTF_VAR_CAST
)
||
(
varTypeIsFloating
(
varDsc
)
&&
varTypeIsFloating
(
tree
))
||
(
varTypeIsStruct
(
varDsc
)
==
varTypeIsStruct
(
tree
)));
/* Remember the type of the reference */
if
(
tree
->
gtType
==
TYP_UNKNOWN
||
varDsc
->
lvType
==
TYP_UNDEF
)
{
varDsc
->
lvType
=
tree
->
gtType
;
noway_assert
(
genActualType
(
varDsc
->
TypeGet
())
==
tree
->
gtType
);
// no truncation
}
#ifdef DEBUG
if
(
tree
->
gtFlags
&
GTF_VAR_CAST
)
{
// it should never be bigger than the variable slot
// Trees don't store the full information about structs
// so we can't check them.
if
(
tree
->
TypeGet
()
!=
TYP_STRUCT
)
{
unsigned
treeSize
=
genTypeSize
(
tree
->
TypeGet
());
unsigned
varSize
=
genTypeSize
(
varDsc
->
TypeGet
());
if
(
varDsc
->
TypeGet
()
==
TYP_STRUCT
)
{
varSize
=
varDsc
->
lvSize
();
}
assert
(
treeSize
<=
varSize
);
}
}
#endif
// Check that the LCL_VAR node has the same type as the underlying variable, save a few mismatches we allow.
assert
(
tree
->
TypeIs
(
varDsc
->
TypeGet
(),
genActualType
(
varDsc
))
||
(
tree
->
TypeIs
(
TYP_I_IMPL
)
&&
(
varDsc
->
TypeGet
()
==
TYP_BYREF
))
||
// Created for spill clique import.
(
tree
->
TypeIs
(
TYP_BYREF
)
&&
(
varDsc
->
TypeGet
()
==
TYP_I_IMPL
))
||
// Created by inliner substitution.
(
tree
->
TypeIs
(
TYP_INT
)
&&
(
varDsc
->
TypeGet
()
==
TYP_LONG
)));
// Created by "optNarrowTree".
}
}
...
...
src/coreclr/jit/morph.cpp
浏览文件 @
db5c4337
...
...
@@ -4548,8 +4548,8 @@ GenTree* Compiler::fgMorphIndexAddr(GenTreeIndexAddr* indexAddr)
{
unsigned arrRefTmpNum = lvaGrabTemp(true DEBUGARG("arr expr"));
arrRefDefn = gtNewTempAssign(arrRefTmpNum, arrRef);
arrRef = gtNewLclvNode(arrRefTmpNum,
arrRef
->TypeGet());
arrRef2 = gtNewLclvNode(arrRefTmpNum,
arrRef
->TypeGet());
arrRef = gtNewLclvNode(arrRefTmpNum,
lvaGetDesc(arrRefTmpNum)
->TypeGet());
arrRef2 = gtNewLclvNode(arrRefTmpNum,
lvaGetDesc(arrRefTmpNum)
->TypeGet());
}
else
{
...
...
@@ -4563,8 +4563,8 @@ GenTree* Compiler::fgMorphIndexAddr(GenTreeIndexAddr* indexAddr)
{
unsigned indexTmpNum = lvaGrabTemp(true DEBUGARG("index expr"));
indexDefn = gtNewTempAssign(indexTmpNum, index);
index = gtNewLclvNode(indexTmpNum,
index
->TypeGet());
index2 = gtNewLclvNode(indexTmpNum,
index
->TypeGet());
index = gtNewLclvNode(indexTmpNum,
lvaGetDesc(indexTmpNum)
->TypeGet());
index2 = gtNewLclvNode(indexTmpNum,
lvaGetDesc(indexTmpNum)
->TypeGet());
}
else
{
...
...
@@ -17285,7 +17285,7 @@ bool Compiler::fgMorphArrayOpsStmt(MorphMDArrayTempCache* pTempCache, BasicBlock
// Side-effect; create a temp.
// unsigned newIdxLcl = m_compiler->lvaGrabTemp(true DEBUGARG("MD array index copy"));
unsigned newIdxLcl = m_pTempCache->GrabTemp(idx->TypeGet());
GenTree* newIdx = m_compiler->gtNewLclvNode(newIdxLcl,
idx->TypeGet(
));
GenTree* newIdx = m_compiler->gtNewLclvNode(newIdxLcl,
genActualType(idx
));
idxToUse[i] = newIdx;
idxToCopy[i] = newIdxLcl;
anyIdxWithSideEffects = true;
...
...
src/coreclr/jit/morphblock.cpp
浏览文件 @
db5c4337
...
...
@@ -1432,7 +1432,6 @@ GenTree* MorphCopyBlockHelper::CopyFieldByField()
(
m_srcVarDsc
->
lvType
==
TYP_STRUCT
)
?
m_srcVarDsc
->
lvExactSize
:
genTypeSize
(
m_srcVarDsc
);
if
(
destSize
==
srcSize
)
{
m_srcLclNode
->
gtFlags
|=
GTF_VAR_CAST
;
m_srcLclNode
->
ChangeOper
(
GT_LCL_FLD
);
m_srcLclNode
->
gtType
=
destType
;
m_comp
->
lvaSetVarDoNotEnregister
(
m_srcLclNum
DEBUGARG
(
DoNotEnregisterReason
::
LocalField
));
...
...
src/coreclr/jit/optimizer.cpp
浏览文件 @
db5c4337
...
...
@@ -5850,12 +5850,6 @@ bool Compiler::optNarrowTree(GenTree* tree, var_types srct, var_types dstt, Valu
tree
->
gtType
=
dstt
;
tree
->
SetVNs
(
vnpNarrow
);
/* Make sure we don't mess up the variable type */
if
((
oper
==
GT_LCL_VAR
)
||
(
oper
==
GT_LCL_FLD
))
{
tree
->
gtFlags
|=
GTF_VAR_CAST
;
}
}
return
true
;
...
...
src/coreclr/jit/valuenum.cpp
浏览文件 @
db5c4337
...
...
@@ -8512,7 +8512,8 @@ void Compiler::fgValueNumberTree(GenTree* tree)
}
else
{
assert
((
varDsc
->
TypeGet
()
==
TYP_I_IMPL
)
&&
lcl
->
TypeIs
(
TYP_BYREF
));
assert
(((
varDsc
->
TypeGet
()
==
TYP_I_IMPL
)
&&
lcl
->
TypeIs
(
TYP_BYREF
))
||
((
varDsc
->
TypeGet
()
==
TYP_BYREF
)
&&
lcl
->
TypeIs
(
TYP_I_IMPL
)));
lcl
->
gtVNPair
=
wholeLclVarVNP
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录