Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6220,7 +6220,7 @@ class Compiler

#endif // FEATURE_SIMD
GenTree* fgMorphArrayIndex(GenTree* tree);
GenTree* fgMorphCast(GenTree* tree);
GenTree* fgMorphExpandCast(GenTreeCast* tree);
GenTreeFieldList* fgMorphLclArgToFieldlist(GenTreeLclVarCommon* lcl);
void fgInitArgInfo(GenTreeCall* call);
GenTreeCall* fgMorphArgs(GenTreeCall* call);
Expand Down Expand Up @@ -6291,8 +6291,10 @@ class Compiler
GenTree* fgMorphCopyBlock(GenTree* tree);
GenTree* fgMorphForRegisterFP(GenTree* tree);
GenTree* fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac = nullptr);
GenTree* fgOptimizeCast(GenTree* tree);
GenTree* fgOptimizeEqualityComparisonWithConst(GenTreeOp* cmp);
GenTree* fgOptimizeRelationalComparisonWithConst(GenTreeOp* cmp);
GenTree* fgPropagateCommaThrow(GenTree* parent, GenTreeOp* commaThrow, GenTreeFlags precedingSideEffects);
GenTree* fgMorphRetInd(GenTreeUnOp* tree);
GenTree* fgMorphModToSubMulDiv(GenTreeOp* tree);
GenTree* fgMorphSmpOpOptional(GenTreeOp* tree);
Expand Down
22 changes: 22 additions & 0 deletions src/coreclr/jit/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,28 @@ void GenTree::BashToConst(T value, var_types type /* = TYP_UNDEF */)
}
}

//------------------------------------------------------------------------
// BashToZeroConst: Bash the node to a constant representing "zero" of "type".
//
// Arguments:
// type - Type the bashed node will have, currently only integers,
// GC types and floating point types are supported.
//
inline void GenTree::BashToZeroConst(var_types type)
{
if (varTypeIsFloating(type))
{
BashToConst(0.0, type);
}
else
{
assert(varTypeIsIntegral(type) || varTypeIsGC(type));

// "genActualType" so that we do not create CNS_INT(small type).
BashToConst(0, genActualType(type));
}
}

/*****************************************************************************
*
* Returns true if the node is of the "ovf" variety, for example, add.ovf.i1.
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15819,6 +15819,7 @@ GenTree* Compiler::gtBuildCommaList(GenTree* list, GenTree* expr)
// Set the flags in the comma node
result->gtFlags |= (list->gtFlags & GTF_ALL_EFFECT);
result->gtFlags |= (expr->gtFlags & GTF_ALL_EFFECT);
DBEXEC(fgGlobalMorph, result->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED);

// 'list' and 'expr' should have valuenumbers defined for both or for neither one (unless we are remorphing,
// in which case a prior transform involving either node may have discarded or otherwise invalidated the value
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1944,6 +1944,8 @@ struct GenTree
template <typename T>
void BashToConst(T value, var_types type = TYP_UNDEF);

void BashToZeroConst(var_types type);

#if NODEBASH_STATS
static void RecordOperBashing(genTreeOps operOld, genTreeOps operNew);
static void ReportOperBashing(FILE* fp);
Expand Down
Loading