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

Commit f9a985d

Browse files
committed
Updating TYP_SIMD locals to no longer undergo struct promotion for HWIntrinsic nodes.
1 parent d9aa56f commit f9a985d

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

src/jit/gentree.cpp

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7319,7 +7319,11 @@ void Compiler::gtBlockOpInit(GenTreePtr result, GenTreePtr dst, GenTreePtr srcOr
73197319
{
73207320
src = src->AsIndir()->Addr()->gtGetOp1();
73217321
}
7322+
#ifdef FEATURE_HW_INTRINSICS
7323+
if ((src->OperGet() == GT_SIMD) || (src->OperGet() == GT_HWIntrinsic))
7324+
#else
73227325
if (src->OperGet() == GT_SIMD)
7326+
#endif // FEATURE_HW_INTRINSICS
73237327
{
73247328
if (dst->OperIsBlk() && (dst->AsIndir()->Addr()->OperGet() == GT_ADDR))
73257329
{
@@ -17850,10 +17854,7 @@ GenTreeSIMD* Compiler::gtNewSIMDNode(
1785017854
{
1785117855
assert(op1 != nullptr);
1785217856
SetOpLclRelatedToSIMDIntrinsic(op1);
17853-
if (op2 != nullptr)
17854-
{
17855-
SetOpLclRelatedToSIMDIntrinsic(op2);
17856-
}
17857+
SetOpLclRelatedToSIMDIntrinsic(op2);
1785717858

1785817859
return new (this, GT_SIMD) GenTreeSIMD(type, op1, op2, simdIntrinsicID, baseType, size);
1785917860
}
@@ -17867,14 +17868,17 @@ GenTreeSIMD* Compiler::gtNewSIMDNode(
1786717868
//
1786817869
void Compiler::SetOpLclRelatedToSIMDIntrinsic(GenTreePtr op)
1786917870
{
17870-
if (op->OperIsLocal())
17871-
{
17872-
setLclRelatedToSIMDIntrinsic(op);
17873-
}
17874-
else if ((op->OperGet() == GT_OBJ) && (op->gtOp.gtOp1->OperGet() == GT_ADDR) &&
17875-
op->gtOp.gtOp1->gtOp.gtOp1->OperIsLocal())
17871+
if (op != nullptr)
1787617872
{
17877-
setLclRelatedToSIMDIntrinsic(op->gtOp.gtOp1->gtOp.gtOp1);
17873+
if (op->OperIsLocal())
17874+
{
17875+
setLclRelatedToSIMDIntrinsic(op);
17876+
}
17877+
else if ((op->OperGet() == GT_OBJ) && (op->gtOp.gtOp1->OperGet() == GT_ADDR) &&
17878+
op->gtOp.gtOp1->gtOp.gtOp1->OperIsLocal())
17879+
{
17880+
setLclRelatedToSIMDIntrinsic(op->gtOp.gtOp1->gtOp.gtOp1);
17881+
}
1787817882
}
1787917883
}
1788017884

@@ -17912,12 +17916,17 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type,
1791217916
GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(
1791317917
var_types type, GenTree* op1, NamedIntrinsic hwIntrinsicID, var_types baseType, unsigned size)
1791417918
{
17919+
SetOpLclRelatedToSIMDIntrinsic(op1);
17920+
1791517921
return new (this, GT_HWIntrinsic) GenTreeHWIntrinsic(type, op1, hwIntrinsicID, baseType, size);
1791617922
}
1791717923

1791817924
GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(
1791917925
var_types type, GenTree* op1, GenTree* op2, NamedIntrinsic hwIntrinsicID, var_types baseType, unsigned size)
1792017926
{
17927+
SetOpLclRelatedToSIMDIntrinsic(op1);
17928+
SetOpLclRelatedToSIMDIntrinsic(op2);
17929+
1792117930
return new (this, GT_HWIntrinsic) GenTreeHWIntrinsic(type, op1, op2, hwIntrinsicID, baseType, size);
1792217931
}
1792317932

@@ -17929,6 +17938,10 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type,
1792917938
var_types baseType,
1793017939
unsigned size)
1793117940
{
17941+
SetOpLclRelatedToSIMDIntrinsic(op1);
17942+
SetOpLclRelatedToSIMDIntrinsic(op2);
17943+
SetOpLclRelatedToSIMDIntrinsic(op3);
17944+
1793217945
return new (this, GT_HWIntrinsic)
1793317946
GenTreeHWIntrinsic(type, gtNewArgList(op1, op2, op3), hwIntrinsicID, baseType, size);
1793417947
}
@@ -17942,12 +17955,19 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type,
1794217955
var_types baseType,
1794317956
unsigned size)
1794417957
{
17958+
SetOpLclRelatedToSIMDIntrinsic(op1);
17959+
SetOpLclRelatedToSIMDIntrinsic(op2);
17960+
SetOpLclRelatedToSIMDIntrinsic(op3);
17961+
SetOpLclRelatedToSIMDIntrinsic(op4);
17962+
1794517963
return new (this, GT_HWIntrinsic)
1794617964
GenTreeHWIntrinsic(type, gtNewArgList(op1, op2, op3, op4), hwIntrinsicID, baseType, size);
1794717965
}
1794817966

1794917967
GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode(var_types type, GenTree* op1, NamedIntrinsic hwIntrinsicID)
1795017968
{
17969+
SetOpLclRelatedToSIMDIntrinsic(op1);
17970+
1795117971
return new (this, GT_HWIntrinsic) GenTreeHWIntrinsic(type, op1, hwIntrinsicID, TYP_UNKNOWN, 0);
1795217972
}
1795317973

@@ -17956,6 +17976,9 @@ GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode(var_types type,
1795617976
GenTree* op2,
1795717977
NamedIntrinsic hwIntrinsicID)
1795817978
{
17979+
SetOpLclRelatedToSIMDIntrinsic(op1);
17980+
SetOpLclRelatedToSIMDIntrinsic(op2);
17981+
1795917982
return new (this, GT_HWIntrinsic) GenTreeHWIntrinsic(type, op1, op2, hwIntrinsicID, TYP_UNKNOWN, 0);
1796017983
}
1796117984

0 commit comments

Comments
 (0)