Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 98492cf

Browse files
Factor signedness test into helper
1 parent 04e0c4c commit 98492cf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/jit/gentree.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,10 @@ struct GenTree
18521852
{
18531853
return (gtFlags & GTF_REVERSE_OPS) ? true : false;
18541854
}
1855+
bool IsUnsigned() const
1856+
{
1857+
return ((gtFlags & GTF_UNSIGNED) != 0);
1858+
}
18551859

18561860
inline bool IsCnsIntOrI() const;
18571861

src/jit/optcse.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ void Compiler::updateCseArrLenMap(GenTreePtr compare)
783783
VNFuncApp cmpVNFuncApp;
784784

785785
if (!vnStore->GetVNFunc(compareVN, &cmpVNFuncApp) ||
786-
(cmpVNFuncApp.m_func != GetVNFuncForOper(compare->OperGet(), (compare->gtFlags & GTF_UNSIGNED) != 0)))
786+
(cmpVNFuncApp.m_func != GetVNFuncForOper(compare->OperGet(), compare->IsUnsigned())))
787787
{
788788
// Value numbering inferred this compare as something other
789789
// than its own operator; leave its value number alone.
@@ -809,12 +809,12 @@ void Compiler::updateCseArrLenMap(GenTreePtr compare)
809809
GenTreePtr op2 = compare->gtGetOp2();
810810

811811
vnStore->GetArrLenArithBoundInfo(compareVN, &info);
812-
if (GetVNFuncForOper(op1->OperGet(), (op1->gtFlags & GTF_UNSIGNED) != 0) == info.arrOper)
812+
if (GetVNFuncForOper(op1->OperGet(), op1->IsUnsigned()) == (VNFunc)info.arrOper)
813813
{
814814
// The arithmetic node is the array length's parent.
815815
arrLenParent = op1;
816816
}
817-
else if (GetVNFuncForOper(op2->OperGet(), (op2->gtFlags & GTF_UNSIGNED) != 0) == info.arrOper)
817+
else if (GetVNFuncForOper(op2->OperGet(), op2->IsUnsigned()) == (VNFunc)info.arrOper)
818818
{
819819
// The arithmetic node is the array length's parent.
820820
arrLenParent = op2;

0 commit comments

Comments
 (0)