Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make intrinsic nodes multi op (aka delete GT_LIST) #59912

Merged
merged 138 commits into from
Nov 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
fc4f3b1
Introducing GenTreeMultiOp
SingleAccretion Sep 19, 2021
b8e6787
Rewrite gtNewSIMDNode
SingleAccretion Sep 19, 2021
97882b8
Rewrite gtNewSIMDVectorZero
SingleAccretion Sep 19, 2021
67332f3
Rewrite gtNewHWIntrinsicNode
SingleAccretion Sep 19, 2021
cb525ad
Rewrite GenTreeSIMD::OperIsMemoryLoad
SingleAccretion Sep 19, 2021
9fb378e
Rewrite GenTreeHWIntrinsic::OperIsMemoryLoad
SingleAccretion Sep 19, 2021
d3ec5c7
Rewrite GenTreeHWIntrinsic::OperIsMemoryStore
SingleAccretion Sep 19, 2021
ba32992
Rewrite GenTree::IsIntegralConstVector
SingleAccretion Sep 19, 2021
98bd7c6
Rewrite GenTree::NullOp1Legal
SingleAccretion Sep 19, 2021
d881afe
Rewrite GenTree::IsSIMDZero
SingleAccretion Sep 18, 2021
ad024f5
Rewrite GenTree::isCommutativeSIMDIntrinsic
SingleAccretion Sep 18, 2021
688d070
Rewrite GenTree::isCommutativeHWIntrinsic
SingleAccretion Sep 18, 2021
b6160fa
Rewrite GenTree::isContainableHWIntrinsic
SingleAccretion Sep 18, 2021
ea66ff0
Rewrite GenTree::isRMWHWIntrinsic
SingleAccretion Sep 18, 2021
cef84b3
Rewrite GenTreeVisitor
SingleAccretion Sep 19, 2021
da16e53
Rewrite GenTreeUseEdgeIterator
SingleAccretion Sep 19, 2021
c7e0026
Rewrite GenTree::VisitOperands
SingleAccretion Sep 19, 2021
01d2a07
Rewrite GenTree::TryGetUse
SingleAccretion Sep 19, 2021
27666fe
Rewrite gtGetChildPointer
SingleAccretion Sep 19, 2021
9cf6b98
Rewrite gtHasRef
SingleAccretion Sep 19, 2021
fdac99e
Rewrite fgSetTreeSeqHelper
SingleAccretion Sep 19, 2021
c294458
Rewrite GenTree::NumChildren
SingleAccretion Sep 19, 2021
74baa40
Rewrite GenTree::GetChild
SingleAccretion Sep 19, 2021
fc9367d
Rewrite GenTree::Compare
SingleAccretion Sep 19, 2021
bbcfd56
Rewrite gtCloneExpr
SingleAccretion Sep 19, 2021
8d11fa5
Rewrite gtSetEvalOrder
SingleAccretion Sep 19, 2021
75d4159
Rewrite gtHashValue
SingleAccretion Sep 19, 2021
0d79aa7
Rewrite gtDispTree
SingleAccretion Sep 19, 2021
425ae87
Rewrite fgDebugCheckFlags
SingleAccretion Sep 19, 2021
0495bf8
Add genConsumeMultiOpOperands
SingleAccretion Sep 19, 2021
f790bc3
Rewrite genConsumeRegs
SingleAccretion Sep 19, 2021
0ee852e
Rewrite HWIntrinsic::HWIntrinsic
SingleAccretion Sep 18, 2021
9bcbc1a
Rewrite HWIntrinsic::InitializeOperands
SingleAccretion Sep 18, 2021
ce27b50
Delete HWIntrinsicInfo::lookupNumArgs
SingleAccretion Sep 19, 2021
d84a932
Delete HWIntrinsicInfo::lookupLastOp
SingleAccretion Sep 19, 2021
ab3859f
Rewrite HWIntrinsicImmOpHelper ARM64
SingleAccretion Sep 18, 2021
6462406
Rewrite inst_RV_TT_IV
SingleAccretion Sep 19, 2021
6b3046e
Rewrite inst_RV_RV_TT
SingleAccretion Sep 19, 2021
4b166f8
Rewrite genSIMDIntrinsic XARCH
SingleAccretion Sep 18, 2021
609c167
Rewrite genSIMDIntrinsicInit XARCH
SingleAccretion Sep 19, 2021
2548050
Rewrite genSIMDIntrinsicInitN XARCH
SingleAccretion Sep 19, 2021
2da641c
Rewrite genSIMDIntrinsicUnOp XARCH
SingleAccretion Sep 19, 2021
ed2316c
Rewrite genSIMDIntrinsic32BitConvert XARCH
SingleAccretion Sep 19, 2021
4289c48
Rewrite genSIMDIntrinsic64BitConvert XARCH
SingleAccretion Sep 19, 2021
a2a0d0f
Rewrite genSIMDIntrinsicWiden XARCH
SingleAccretion Sep 19, 2021
d31386f
Rewrite genSIMDIntrinsicNarrow XARCH
SingleAccretion Sep 19, 2021
565e9e6
Rewrite genSIMDIntrinsicBinOp XARCH
SingleAccretion Sep 19, 2021
54e9239
Rewrite genSIMDIntrinsicRelOp XARCH
SingleAccretion Sep 18, 2021
7afd5be
Rewrite genSIMDIntrinsicShuffleSSE2 XARCH
SingleAccretion Sep 19, 2021
913ed8f
Rewrite genSIMDIntrinsicUpperSave XARCH
SingleAccretion Sep 19, 2021
1b38d92
Rewrite genSIMDIntrinsicUpperRestore XARCH
SingleAccretion Sep 19, 2021
a15c832
Rewrite genSIMDIntrinsic ARM64
SingleAccretion Sep 18, 2021
d6fd0a2
Rewrite genSIMDIntrinsicInit ARM64
SingleAccretion Sep 18, 2021
a80906e
Rewrite genSIMDIntrinsicInitN ARM64
SingleAccretion Sep 18, 2021
03724d4
Rewrite genSIMDIntrinsicUnOp ARM64
SingleAccretion Sep 18, 2021
5a40435
Rewrite genSIMDIntrinsicWiden ARM64
SingleAccretion Sep 18, 2021
e4bf675
Rewrite genSIMDIntrinsicNarrow ARM64
SingleAccretion Sep 18, 2021
973d6f5
Rewrite genSIMDIntrinsicBinOp ARM64
SingleAccretion Sep 18, 2021
4f7c38f
Rewrite genSIMDIntrinsicUpperSave ARM64
SingleAccretion Sep 18, 2021
fb2ba6f
Rewrite genSIMDIntrinsicUpperRestore ARM64
SingleAccretion Sep 18, 2021
edf1f90
Rewrite genHWIntrinsic_R_RM XARCH
SingleAccretion Sep 19, 2021
053a97b
Rewrite genHWIntrinsic_R_RM_I XARCH
SingleAccretion Sep 19, 2021
32ded29
Rewrite genHWIntrinsic_R_R_RM XARCH
SingleAccretion Sep 19, 2021
0dff891
Rewrite genHWIntrinsic_R_R_RM_I XARCH
SingleAccretion Sep 19, 2021
4c45da8
Rewrite genHWIntrinsic_R_R_RM_R XARCH
SingleAccretion Sep 19, 2021
0183e5d
Rewrite genHWIntrinsic_R_R_R_RM XARCH
SingleAccretion Sep 19, 2021
55afb24
Rewrite genHWIntrinsic XARCH
SingleAccretion Sep 19, 2021
e6e6c00
Rewrite genBaseIntrinsic XARCH
SingleAccretion Sep 19, 2021
c0e2d74
Rewrite genX86BaseIntrinsic XARCH
SingleAccretion Sep 19, 2021
71c87aa
Rewrite genSSEIntrinsic XARCH
SingleAccretion Sep 19, 2021
e7a79b9
Rewrite genSSE2Intrinsic XARCH
SingleAccretion Sep 19, 2021
0c71d16
Rewrite genSSE41Intrinsic XARCH
SingleAccretion Sep 19, 2021
0e5ac65
Rewrite genSSE42Intrinsic XARCH
SingleAccretion Sep 19, 2021
f67485b
Rewrite genAvxOrAvx2Intrinsic XARCH
SingleAccretion Sep 19, 2021
e34efe6
Rewrite genBMI1OrBMI2Intrinsic XARCH
SingleAccretion Sep 19, 2021
451481b
Rewrite genFMAIntrinsic XARCH
SingleAccretion Sep 19, 2021
af12e82
Rewrite genLZCNTIntrinsic XARCH
SingleAccretion Sep 19, 2021
793116b
Rewrite genPOPCNTIntrinsic XARCH
SingleAccretion Sep 19, 2021
fbd8a83
Rewrite genXCNTIntrinsic XARCH
SingleAccretion Sep 19, 2021
6ec5515
Rewrite genHWIntrinsic ARM64
SingleAccretion Sep 18, 2021
1f26bac
Rewrite insertUpperVectorSave
SingleAccretion Sep 19, 2021
bdccb8d
Rewrite insertUpperVectorRestore
SingleAccretion Sep 19, 2021
efb0497
Rewrite getKillSetForHWIntrinsic
SingleAccretion Sep 18, 2021
58179aa
Rewrite BuildSIMD XARCH
SingleAccretion Sep 19, 2021
93c0538
Rewrite BuildOperandUses/BuildDelayFreeUses
SingleAccretion Sep 19, 2021
baa4dd6
Rewrite BuildSIMD ARM64
SingleAccretion Sep 18, 2021
77a509c
Rewrite BuildHWIntrinsic XARCH
SingleAccretion Sep 19, 2021
3b01249
Rewrite LowerSIMD XARCH
SingleAccretion Sep 19, 2021
fda30f1
Rewrite ContainCheckSIMD XARCH
SingleAccretion Sep 19, 2021
c54b0ae
Rewrite LowerHWIntrinsicCC XARCH
SingleAccretion Sep 19, 2021
345baef
Rewrite LowerFusedMultiplyAdd XARCH
SingleAccretion Sep 19, 2021
ed27dfa
Rewrite LowerHWIntrinsic XARCH
SingleAccretion Sep 19, 2021
8cb253b
Rewrite LowerHWIntrinsicCmpOp XARCH
SingleAccretion Sep 19, 2021
1e8203a
Rewrite LowerHWIntrinsicGetElement XARCH
SingleAccretion Sep 19, 2021
8f8c5ab
Rewrite LowerHWIntrinsicWithElement XARCH
SingleAccretion Sep 19, 2021
fe43bf8
Rewrite LowerHWIntrinsicCreate XARCH
SingleAccretion Sep 19, 2021
b4bcb30
Rewrite LowerHWIntrinsicDot XARCH
SingleAccretion Sep 19, 2021
d75e9d6
Rewrite LowerHWIntrinsicToScalar XARCH
SingleAccretion Sep 19, 2021
5542069
Rewrite IsContainableHWIntrinsicOp XARCH
SingleAccretion Sep 19, 2021
0de2e7a
Rewrite ContainCheckHWIntrinsic XARCH
SingleAccretion Sep 19, 2021
0be52b3
Rewrite IsValidConstForMovImm ARM64
SingleAccretion Sep 18, 2021
0f9615f
Rewrite LowerHWIntrinsic ARM64
SingleAccretion Sep 18, 2021
ab6c992
Rewrite LowerHWIntrinsicFusedMultiplyAddScalar ARM64
SingleAccretion Sep 18, 2021
4d0b675
Rewrite LowerHWIntrinsicCmpOp ARM64
SingleAccretion Sep 18, 2021
b46e839
Rewrite LowerHWIntrinsicCreate ARM64
SingleAccretion Sep 18, 2021
9929e7b
Rewrite LowerHWIntrinsicDot ARM64
SingleAccretion Sep 18, 2021
4a96d7c
Rewrite ContainCheckStoreLoc ARM64
SingleAccretion Sep 18, 2021
07ba4d4
Rewrite ContainCheckSIMD ARM64
SingleAccretion Sep 18, 2021
11d39cd
Rewrite ContainCheckHWIntrinsic ARM64
SingleAccretion Sep 18, 2021
c438283
Rewrite DecomposeHWIntrinsicGetElement X86
SingleAccretion Sep 18, 2021
1932817
Rewrite DecomposeHWIntrinsic X86
SingleAccretion Sep 18, 2021
02dc5a7
Rewrite Rationalizer::RewriteNode
SingleAccretion Sep 19, 2021
4cc83da
Rewrite optIsCSEcandidate
SingleAccretion Sep 18, 2021
ffabd4e
Rewrite fgValueNumberTree
SingleAccretion Sep 19, 2021
8f9994c
Rewrite fgValueNumberSimd
SingleAccretion Sep 19, 2021
753a163
Rewrite fgValueNumberHWIntrinsic
SingleAccretion Sep 19, 2021
8c6e56f
Rewrite GetVNFuncForNode
SingleAccretion Sep 18, 2021
6a8b6d7
Rewrite fgMorphTree & fgMorphSmpOpOptional
SingleAccretion Sep 19, 2021
7687110
Rewrite fgMorphFieldToSimdGetElement/fgMorphField
SingleAccretion Sep 19, 2021
7fa5948
Rewrite fgMorphOneAsgBlockOp
SingleAccretion Oct 4, 2021
5b2e1fa
Rewrite impInlineFetchArg
SingleAccretion Oct 4, 2021
06c7e8c
Rewrite impSIMDRelOp
SingleAccretion Sep 19, 2021
4141820
Rewrite impSIMDIntrinsic
SingleAccretion Sep 19, 2021
3351111
Rewrite impBaseIntrinsic XARCH
SingleAccretion Sep 19, 2021
7f31729
Rewrite impAvxOrAvx2Intrinsic XARCH
SingleAccretion Sep 19, 2021
b65e3c0
Rewrite impSpecialIntrinsic ARM64
SingleAccretion Sep 19, 2021
04cfce7
Fix SSA Builder comments
SingleAccretion Sep 19, 2021
c417f73
Delete GT_LIST
SingleAccretion Sep 18, 2021
9a01ae4
Support GTF_REVERSE_OPS for GenTreeMultiOp
SingleAccretion Oct 3, 2021
5fccf67
Fix Linux x86 build break
SingleAccretion Nov 6, 2021
45171ec
Fix formatting
SingleAccretion Nov 10, 2021
a0991d3
Improve readability through the use of a local
SingleAccretion Nov 10, 2021
476d213
Merge branch 'main' into Make-Intrinsic-Nodes-Multi-Op
SingleAccretion Nov 10, 2021
b53c956
Support external operand arrays in GenTreeMultiOp
SingleAccretion Nov 11, 2021
fee7225
Fix formatting
SingleAccretion Nov 11, 2021
dcb4ed0
Merge branch 'main' into Make-Intrinsic-Nodes-Multi-Op
SingleAccretion Nov 12, 2021
2c077eb
Merge branch 'main' into Make-Intrinsic-Nodes-Multi-Op
SingleAccretion Nov 18, 2021
0910804
Tweak a constructor call
SingleAccretion Nov 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,8 +1258,7 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
optAssertionKind assertionKind,
bool helperCallArgs)
{
assert((op1 != nullptr) && !op1->OperIs(GT_LIST));
assert((op2 == nullptr) || !op2->OperIs(GT_LIST));
assert(op1 != nullptr);
assert(!helperCallArgs || (op2 != nullptr));

AssertionDsc assertion = {OAK_INVALID};
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1130,9 +1130,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

void genConsumeRegs(GenTree* tree);
void genConsumeOperands(GenTreeOp* tree);
#ifdef FEATURE_HW_INTRINSICS
void genConsumeHWIntrinsicOperands(GenTreeHWIntrinsic* tree);
#endif // FEATURE_HW_INTRINSICS
#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS)
void genConsumeMultiOpOperands(GenTreeMultiOp* tree);
#endif
void genEmitGSCookieCheck(bool pushReg);
void genCodeForShift(GenTree* tree);

Expand Down
77 changes: 37 additions & 40 deletions src/coreclr/jit/codegenarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3879,7 +3879,7 @@ void CodeGen::genSIMDIntrinsic(GenTreeSIMD* simdNode)
noway_assert(!"SIMD intrinsic with unsupported base type.");
}

switch (simdNode->gtSIMDIntrinsicID)
switch (simdNode->GetSIMDIntrinsicId())
{
case SIMDIntrinsicInit:
genSIMDIntrinsicInit(simdNode);
Expand Down Expand Up @@ -4039,15 +4039,15 @@ instruction CodeGen::getOpForSIMDIntrinsic(SIMDIntrinsicID intrinsicId, var_type
//
void CodeGen::genSIMDIntrinsicInit(GenTreeSIMD* simdNode)
{
assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInit);
assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicInit);

GenTree* op1 = simdNode->gtGetOp1();
GenTree* op1 = simdNode->Op(1);
var_types baseType = simdNode->GetSimdBaseType();
regNumber targetReg = simdNode->GetRegNum();
assert(targetReg != REG_NA);
var_types targetType = simdNode->TypeGet();

genConsumeOperands(simdNode);
genConsumeMultiOpOperands(simdNode);
regNumber op1Reg = op1->IsIntegralConst(0) ? REG_ZR : op1->GetRegNum();

// TODO-ARM64-CQ Add LD1R to allow SIMDIntrinsicInit from contained memory
Expand Down Expand Up @@ -4090,16 +4090,18 @@ void CodeGen::genSIMDIntrinsicInit(GenTreeSIMD* simdNode)
//
void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode)
{
assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInitN);
assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicInitN);

regNumber targetReg = simdNode->GetRegNum();
assert(targetReg != REG_NA);

var_types targetType = simdNode->TypeGet();

var_types baseType = simdNode->GetSimdBaseType();
var_types targetType = simdNode->TypeGet();
var_types baseType = simdNode->GetSimdBaseType();
emitAttr baseTypeSize = emitTypeSize(baseType);
regNumber vectorReg = targetReg;
size_t initCount = simdNode->GetOperandCount();

regNumber vectorReg = targetReg;
assert((initCount * baseTypeSize) <= simdNode->GetSimdSize());

if (varTypeIsFloating(baseType))
{
Expand All @@ -4108,24 +4110,17 @@ void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode)
vectorReg = simdNode->GetSingleTempReg(RBM_ALLFLOAT);
}

emitAttr baseTypeSize = emitTypeSize(baseType);

// We will first consume the list items in execution (left to right) order,
// and record the registers.
regNumber operandRegs[FP_REGSIZE_BYTES];
unsigned initCount = 0;
for (GenTree* list = simdNode->gtGetOp1(); list != nullptr; list = list->gtGetOp2())
for (size_t i = 1; i <= initCount; i++)
{
assert(list->OperGet() == GT_LIST);
GenTree* listItem = list->gtGetOp1();
assert(listItem->TypeGet() == baseType);
assert(!listItem->isContained());
regNumber operandReg = genConsumeReg(listItem);
operandRegs[initCount] = operandReg;
initCount++;
}
GenTree* operand = simdNode->Op(i);
assert(operand->TypeIs(baseType));
assert(!operand->isContained());

assert((initCount * baseTypeSize) <= simdNode->GetSimdSize());
operandRegs[i - 1] = genConsumeReg(operand);
}

if (initCount * baseTypeSize < EA_16BYTE)
{
Expand Down Expand Up @@ -4164,25 +4159,25 @@ void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode)
//
void CodeGen::genSIMDIntrinsicUnOp(GenTreeSIMD* simdNode)
{
assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicCast ||
simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToSingle ||
simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToInt32 ||
simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToDouble ||
simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToInt64);
assert((simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicCast) ||
(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToSingle) ||
(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToInt32) ||
(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToDouble) ||
(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToInt64));

GenTree* op1 = simdNode->gtGetOp1();
GenTree* op1 = simdNode->Op(1);
var_types baseType = simdNode->GetSimdBaseType();
regNumber targetReg = simdNode->GetRegNum();
assert(targetReg != REG_NA);
var_types targetType = simdNode->TypeGet();

genConsumeOperands(simdNode);
genConsumeMultiOpOperands(simdNode);
regNumber op1Reg = op1->GetRegNum();

assert(genIsValidFloatReg(op1Reg));
assert(genIsValidFloatReg(targetReg));

instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType);
instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType);
emitAttr attr = (simdNode->GetSimdSize() > 8) ? EA_16BYTE : EA_8BYTE;

if (GetEmitter()->IsMovInstruction(ins))
Expand All @@ -4208,17 +4203,19 @@ void CodeGen::genSIMDIntrinsicUnOp(GenTreeSIMD* simdNode)
//
void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode)
{
assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicSub || simdNode->gtSIMDIntrinsicID == SIMDIntrinsicBitwiseAnd ||
simdNode->gtSIMDIntrinsicID == SIMDIntrinsicBitwiseOr || simdNode->gtSIMDIntrinsicID == SIMDIntrinsicEqual);
assert((simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicSub) ||
(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicBitwiseAnd) ||
(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicBitwiseOr) ||
(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicEqual));

GenTree* op1 = simdNode->gtGetOp1();
GenTree* op2 = simdNode->gtGetOp2();
GenTree* op1 = simdNode->Op(1);
GenTree* op2 = simdNode->Op(2);
var_types baseType = simdNode->GetSimdBaseType();
regNumber targetReg = simdNode->GetRegNum();
assert(targetReg != REG_NA);
var_types targetType = simdNode->TypeGet();

genConsumeOperands(simdNode);
genConsumeMultiOpOperands(simdNode);
regNumber op1Reg = op1->GetRegNum();
regNumber op2Reg = op2->GetRegNum();

Expand All @@ -4228,7 +4225,7 @@ void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode)

// TODO-ARM64-CQ Contain integer constants where posible

instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType);
instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType);
emitAttr attr = (simdNode->GetSimdSize() > 8) ? EA_16BYTE : EA_8BYTE;
insOpts opt = genGetSimdInsOpt(attr, baseType);

Expand Down Expand Up @@ -4257,9 +4254,9 @@ void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode)
//
void CodeGen::genSIMDIntrinsicUpperSave(GenTreeSIMD* simdNode)
{
assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicUpperSave);
assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicUpperSave);

GenTree* op1 = simdNode->gtGetOp1();
GenTree* op1 = simdNode->Op(1);
GenTreeLclVar* lclNode = op1->AsLclVar();
LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode);
assert(emitTypeSize(varDsc->GetRegisterType(lclNode)) == 16);
Expand Down Expand Up @@ -4307,9 +4304,9 @@ void CodeGen::genSIMDIntrinsicUpperSave(GenTreeSIMD* simdNode)
//
void CodeGen::genSIMDIntrinsicUpperRestore(GenTreeSIMD* simdNode)
{
assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicUpperRestore);
assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicUpperRestore);

GenTree* op1 = simdNode->gtGetOp1();
GenTree* op1 = simdNode->Op(1);
assert(op1->IsLocal());
GenTreeLclVar* lclNode = op1->AsLclVar();
LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode);
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode)
// This is handled at the time we call genConsumeReg() on the GT_COPY
break;

case GT_LIST:
case GT_FIELD_LIST:
// Should always be marked contained.
assert(!"LIST, FIELD_LIST nodes should always be marked contained.");
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,8 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTree* op, unsigned* alignme
{
opSize = (unsigned)op2->AsIntCon()->gtIconVal;
GenTree* op1 = op->AsOp()->gtOp1;
assert(op1->OperGet() == GT_LIST);
// TODO-List-Cleanup: this looks like some really old dead code.
// assert(op1->OperGet() == GT_LIST);
GenTree* dstAddr = op1->AsOp()->gtOp1;
if (dstAddr->OperGet() == GT_ADDR)
{
Expand Down
60 changes: 17 additions & 43 deletions src/coreclr/jit/codegenlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,14 +1620,18 @@ void CodeGen::genConsumeRegs(GenTree* tree)
else if (tree->OperIs(GT_HWINTRINSIC))
{
// Only load/store HW intrinsics can be contained (and the address may also be contained).
HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(tree->AsHWIntrinsic()->gtHWIntrinsicId);
HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(tree->AsHWIntrinsic()->GetHWIntrinsicId());
assert((category == HW_Category_MemoryLoad) || (category == HW_Category_MemoryStore));
int numArgs = HWIntrinsicInfo::lookupNumArgs(tree->AsHWIntrinsic());
genConsumeAddress(tree->gtGetOp1());
size_t numArgs = tree->AsHWIntrinsic()->GetOperandCount();
genConsumeAddress(tree->AsHWIntrinsic()->Op(1));
if (category == HW_Category_MemoryStore)
{
assert((numArgs == 2) && !tree->gtGetOp2()->isContained());
genConsumeReg(tree->gtGetOp2());
assert(numArgs == 2);

GenTree* op2 = tree->AsHWIntrinsic()->Op(2);
assert(op2->isContained());

genConsumeReg(op2);
}
else
{
Expand Down Expand Up @@ -1671,7 +1675,6 @@ void CodeGen::genConsumeRegs(GenTree* tree)
// Return Value:
// None.
//

void CodeGen::genConsumeOperands(GenTreeOp* tree)
{
GenTree* firstOp = tree->gtOp1;
Expand All @@ -1687,54 +1690,25 @@ void CodeGen::genConsumeOperands(GenTreeOp* tree)
}
}

#ifdef FEATURE_HW_INTRINSICS
#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS)
//------------------------------------------------------------------------
// genConsumeHWIntrinsicOperands: Do liveness update for the operands of a GT_HWINTRINSIC node
// genConsumeOperands: Do liveness update for the operands of a multi-operand node,
// currently GT_SIMD or GT_HWINTRINSIC
//
// Arguments:
// node - the GenTreeHWIntrinsic node whose operands will have their liveness updated.
// tree - the GenTreeMultiOp whose operands will have their liveness updated.
//
// Return Value:
// None.
//

void CodeGen::genConsumeHWIntrinsicOperands(GenTreeHWIntrinsic* node)
void CodeGen::genConsumeMultiOpOperands(GenTreeMultiOp* tree)
{
int numArgs = HWIntrinsicInfo::lookupNumArgs(node);
GenTree* op1 = node->gtGetOp1();
if (op1 == nullptr)
for (GenTree* operand : tree->Operands())
{
assert((numArgs == 0) && (node->gtGetOp2() == nullptr));
return;
}
if (op1->OperIs(GT_LIST))
{
int foundArgs = 0;
assert(node->gtGetOp2() == nullptr);
for (GenTreeArgList* list = op1->AsArgList(); list != nullptr; list = list->Rest())
{
GenTree* operand = list->Current();
genConsumeRegs(operand);
foundArgs++;
}
assert(foundArgs == numArgs);
}
else
{
genConsumeRegs(op1);
GenTree* op2 = node->gtGetOp2();
if (op2 != nullptr)
{
genConsumeRegs(op2);
assert(numArgs == 2);
}
else
{
assert(numArgs == 1);
}
genConsumeRegs(operand);
}
}
#endif // FEATURE_HW_INTRINSICS
#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS)

#if FEATURE_PUT_STRUCT_ARG_STK
//------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,6 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode)
// This is handled at the time we call genConsumeReg() on the GT_COPY
break;

case GT_LIST:
case GT_FIELD_LIST:
// Should always be marked contained.
assert(!"LIST, FIELD_LIST nodes should always be marked contained.");
Expand Down
Loading