diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index 69343cf0965b46..a0996f5b5de074 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -3289,11 +3289,8 @@ GenTree* Compiler::optCopyAssertionProp(AssertionDsc* curAssertion, // GenTree* Compiler::optAssertionProp_LclVar(ASSERT_VALARG_TP assertions, GenTreeLclVarCommon* tree, Statement* stmt) { - // If we have a var definition then bail or - // If this is the address of the var then it will have the GTF_DONT_CSE - // flag set and we don't want to assertion prop on it. - // TODO-ASG: delete. - if (tree->gtFlags & (GTF_VAR_DEF | GTF_DONT_CSE)) + // TODO-Cleanup: delete. Requires annotating locals propagated into multi-regs. + if ((tree->gtFlags & GTF_DONT_CSE) != 0) { return nullptr; } @@ -3395,15 +3392,6 @@ GenTree* Compiler::optAssertionProp_LclVar(ASSERT_VALARG_TP assertions, GenTreeL // GenTree* Compiler::optAssertionProp_LclFld(ASSERT_VALARG_TP assertions, GenTreeLclVarCommon* tree, Statement* stmt) { - // If we have a var definition then bail or - // If this is the address of the var then it will have the GTF_DONT_CSE - // flag set and we don't want to assertion prop on it. - // TODO-ASG: delete. - if (tree->gtFlags & (GTF_VAR_DEF | GTF_DONT_CSE)) - { - return nullptr; - } - // Only run during local prop and if copies are available. // if (!optLocalAssertionProp || !optCanPropLclVar) @@ -5724,24 +5712,18 @@ GenTree* Compiler::optVNConstantPropOnJTrue(BasicBlock* block, GenTree* test) Compiler::fgWalkResult Compiler::optVNConstantPropCurStmt(BasicBlock* block, Statement* stmt, GenTree* tree) { // Don't perform const prop on expressions marked with GTF_DONT_CSE - // TODO-ASG: delete. + // TODO-Cleanup: delete. This is now only needed for the casts under a GTF_MUL_64RSLT node to stay intact. if (!tree->CanCSE()) { return WALK_CONTINUE; } - // Don't propagate floating-point constants into a TYP_STRUCT LclVar - // This can occur for HFA return values (see hfa_sf3E_r.exe) - if (tree->TypeGet() == TYP_STRUCT) - { - return WALK_CONTINUE; - } - switch (tree->OperGet()) { // Make sure we have an R-value. case GT_ADD: case GT_SUB: + case GT_MUL: case GT_DIV: case GT_MOD: case GT_UDIV: @@ -5768,7 +5750,6 @@ Compiler::fgWalkResult Compiler::optVNConstantPropCurStmt(BasicBlock* block, Sta case GT_ARR_LENGTH: break; - case GT_BLK: case GT_IND: { const ValueNum vn = tree->GetVN(VNK_Conservative); @@ -5782,14 +5763,6 @@ Compiler::fgWalkResult Compiler::optVNConstantPropCurStmt(BasicBlock* block, Sta case GT_JTRUE: break; - case GT_MUL: - // Don't transform long multiplies. - if (tree->gtFlags & GTF_MUL_64RSLT) - { - return WALK_CONTINUE; - } - break; - case GT_LCL_VAR: case GT_LCL_FLD: // Let's not conflict with CSE (to save the movw/movt). diff --git a/src/coreclr/jit/earlyprop.cpp b/src/coreclr/jit/earlyprop.cpp index 1bbf3ec95700d9..2f41f8d78f7871 100644 --- a/src/coreclr/jit/earlyprop.cpp +++ b/src/coreclr/jit/earlyprop.cpp @@ -771,12 +771,6 @@ bool Compiler::optCanMoveNullCheckPastTree(GenTree* tree, { // We disallow stores to global memory. result = tree->OperIsLocalStore() && !lvaGetDesc(tree->AsLclVarCommon())->IsAddressExposed(); - - // TODO-ASG-Cleanup: delete this zero-diff quirk. Some setup args for by-ref args do not have GLOB_REF. - if ((tree->gtFlags & GTF_GLOB_REF) == 0) - { - result = true; - } } } else if (checkSideEffectSummary) diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 0b24cbda69bbae..3e21bae6a35bf9 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -9059,12 +9059,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) lclTyp = TypeHandleToVarType(fieldInfo.fieldType, clsHnd, &layout); op1 = (lclTyp == TYP_STRUCT) ? gtNewBlkIndir(layout, op1, indirFlags) : gtNewIndir(lclTyp, op1, indirFlags); - if ((indirFlags & GTF_IND_INVARIANT) != 0) - { - // TODO-ASG: delete this zero-diff quirk. - op1->gtFlags |= GTF_GLOB_REF; - } - impAnnotateFieldIndir(op1->AsIndir()); } diff --git a/src/coreclr/jit/lclmorph.cpp b/src/coreclr/jit/lclmorph.cpp index 7ebba3c14bdca7..5d52b876d1fbdb 100644 --- a/src/coreclr/jit/lclmorph.cpp +++ b/src/coreclr/jit/lclmorph.cpp @@ -1273,7 +1273,7 @@ class LocalAddressVisitor final : public GenTreeVisitor else { node->ChangeOper(GT_LCL_VAR); - node->gtFlags &= (GTF_NODE_MASK | GTF_DONT_CSE); // TODO-ASG-Cleanup: delete this zero-diff quirk. + node->gtFlags = GTF_EMPTY; } node->AsLclVar()->SetLclNum(fieldLclNum); node->gtType = fieldType; diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index ab10da3bed3631..d665460b64762f 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -4578,8 +4578,7 @@ GenTree* Compiler::fgMorphLeafLocal(GenTreeLclVarCommon* lclNode) // normalized on store. If this is one of the former, insert a narrowing cast on the load. // ie. Convert: var-short --> cast-short(var-int) // - if (fgGlobalMorph && lclNode->OperIs(GT_LCL_VAR) && varDsc->lvNormalizeOnLoad() && - /* TODO-ASG: delete this zero-diff quirk */ lclNode->CanCSE()) + if (fgGlobalMorph && lclNode->OperIs(GT_LCL_VAR) && varDsc->lvNormalizeOnLoad()) { var_types lclVarType = varDsc->TypeGet(); @@ -7429,7 +7428,6 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa { GenTree* zero = (lclType == TYP_STRUCT) ? gtNewIconNode(0) : gtNewZeroConNode(lclType); GenTree* init = gtNewStoreLclVarNode(varNum, zero); - init->gtType = lclType; // TODO-ASG: delete this zero-diff quirk. if (lclType == TYP_STRUCT) { init = fgMorphInitBlock(init); @@ -9772,8 +9770,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac, bool* optA // Propagate comma throws. // If we are in the Valuenum CSE phase then don't morph away anything as these // nodes may have CSE defs/uses in them. - if (fgGlobalMorph && (oper != GT_COLON) && - /* TODO-ASG-Cleanup: delete this zero-diff quirk */ !GenTree::OperIsStore(oper)) + if (fgGlobalMorph && (oper != GT_COLON)) { if ((op1 != nullptr) && fgIsCommaThrow(op1, true)) { diff --git a/src/coreclr/jit/ssabuilder.cpp b/src/coreclr/jit/ssabuilder.cpp index 774e51ee8f9872..452af2843ceb07 100644 --- a/src/coreclr/jit/ssabuilder.cpp +++ b/src/coreclr/jit/ssabuilder.cpp @@ -519,7 +519,6 @@ void SsaBuilder::InsertPhi(BasicBlock* block, unsigned lclNum) phi->SetCosts(0, 0); GenTree* store = m_pCompiler->gtNewStoreLclVarNode(lclNum, phi); store->SetCosts(0, 0); - store->gtType = type; // TODO-ASG-Cleanup: delete. This quirk avoided diffs from costing-induced tail dup. // Create the statement and chain everything in linear order - PHI, STORE_LCL_VAR. Statement* stmt = m_pCompiler->gtNewStmt(store);