Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address some feedback
  • Loading branch information
jakobbotsch committed Sep 28, 2023
commit d28c644c3de2c6c6d6e98ca8be65af06865ac2c3
20 changes: 13 additions & 7 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7036,7 +7036,13 @@ bool GenTree::OperMayThrow(Compiler* comp)
// True if the given operator requires GTF_GLOB_REF
//
// Remarks:
// Only valid after local morph.
// Globally visible stores and loads, as well as some equivalently modeled
// operations, require the GLOB_REF flag to be set on the node.
//
// This function is only valid after local morph when we know which locals
// are address exposed, and the flag in gtFlags is only kept valid after
// morph has run. Before local morph the property can be conservatively
// approximated for locals with lvHasLdAddrOp.
//
bool GenTree::OperRequiresGlobRefFlag(Compiler* comp) const
{
Expand Down Expand Up @@ -7072,6 +7078,9 @@ bool GenTree::OperRequiresGlobRefFlag(Compiler* comp) const
case GT_CALL:
return AsCall()->HasSideEffects(comp, /* ignoreExceptions */ true);

case GT_ALLOCOBJ:
return AsAllocObj()->gtHelperHasSideEffects;

#if defined(FEATURE_HW_INTRINSICS)
case GT_HWINTRINSIC:
return AsHWIntrinsic()->OperRequiresGlobRefFlag();
Expand Down Expand Up @@ -7121,9 +7130,6 @@ bool GenTree::OperSupportsOrderingSideEffect() const
case GT_CMPXCHG:
case GT_MEMORYBARRIER:
case GT_CATCH_ARG:
#if defined(FEATURE_HW_INTRINSICS)
case GT_HWINTRINSIC:
#endif
return true;
default:
return false;
Expand Down Expand Up @@ -7164,7 +7170,7 @@ GenTreeFlags GenTree::OperEffects(Compiler* comp)
flags &= ~GTF_GLOB_REF;
}

if ((flags & GTF_ORDER_SIDEEFF) != 0 && !OperSupportsOrderingSideEffect())
if (((flags & GTF_ORDER_SIDEEFF) != 0) && !OperSupportsOrderingSideEffect())
{
flags &= ~GTF_ORDER_SIDEEFF;
}
Expand Down Expand Up @@ -25492,8 +25498,8 @@ bool GenTreeHWIntrinsic::OperRequiresCallFlag() const
}

//------------------------------------------------------------------------------
// OperRequiresCallFlag : Check whether the operation requires GTF_GLOB_REF flag regardless
// of the children's flags.
// OperRequiresGlobRefFlag : Check whether the operation requires GTF_GLOB_REF
// flag regardless of the children's flags.
//
bool GenTreeHWIntrinsic::OperRequiresGlobRefFlag() const
{
Expand Down
5 changes: 3 additions & 2 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1863,7 +1863,6 @@ struct GenTree

bool OperSupportsOrderingSideEffect() const;

// Compute effect flags that only pertain to this node excluding its children.
GenTreeFlags OperEffects(Compiler* comp);

unsigned GetScaleIndexMul();
Expand Down Expand Up @@ -7188,7 +7187,9 @@ struct GenTreeIndir : public GenTreeOp
// True if this indirection is invariant.
bool IsInvariantLoad() const
{
return (gtFlags & GTF_IND_INVARIANT) != 0;
bool isInvariant = (gtFlags & GTF_IND_INVARIANT) != 0;
assert(!isInvariant || OperIs(GT_IND, GT_BLK));
return isInvariant;
}

#if DEBUGGABLE_GENTREE
Expand Down