Skip to content

Commit

Permalink
Restore "Start generating LCL_FLDs in LocalAddressVisitor #737" (#991)
Browse files Browse the repository at this point in the history
* Revert "Revert "Start generating LCL_FLDs in LocalAddressVisitor (#737)" (#973)"

This reverts commit 9bf91f8.

* Add a test that produces an unused, top-level indir

* If an indir has no user then it's not a def

* Fix test return code
  • Loading branch information
mikedn authored and Sergey Andreenko committed Dec 20, 2019
1 parent 8e51dc3 commit 423c1eb
Show file tree
Hide file tree
Showing 7 changed files with 289 additions and 59 deletions.
1 change: 1 addition & 0 deletions src/coreclr/src/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7955,6 +7955,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

void setLclRelatedToSIMDIntrinsic(GenTree* tree);
bool areFieldsContiguous(GenTree* op1, GenTree* op2);
bool areLocalFieldsContiguous(GenTreeLclFld* first, GenTreeLclFld* second);
bool areArrayElementsContiguous(GenTree* op1, GenTree* op2);
bool areArgumentsContiguous(GenTree* op1, GenTree* op2);
GenTree* createAddressNodeForSIMDInit(GenTree* tree, unsigned simdSize);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18009,7 +18009,7 @@ bool FieldSeqNode::IsConstantIndexFieldSeq()
return m_fieldHnd == FieldSeqStore::ConstantIndexPseudoField;
}

bool FieldSeqNode::IsPseudoField()
bool FieldSeqNode::IsPseudoField() const
{
return m_fieldHnd == FieldSeqStore::FirstElemPseudoField || m_fieldHnd == FieldSeqStore::ConstantIndexPseudoField;
}
Expand Down
49 changes: 36 additions & 13 deletions src/coreclr/src/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,23 @@ struct FieldSeqNode
bool IsConstantIndexFieldSeq();

// returns true when this is the the pseudo #FirstElem field sequence or the pseudo #ConstantIndex field sequence
bool IsPseudoField();
bool IsPseudoField() const;

CORINFO_FIELD_HANDLE GetFieldHandle() const
{
assert(!IsPseudoField() && (m_fieldHnd != nullptr));
return m_fieldHnd;
}

FieldSeqNode* GetTail()
{
FieldSeqNode* tail = this;
while (tail->m_next != nullptr)
{
tail = tail->m_next;
}
return tail;
}

// Make sure this provides methods that allow it to be used as a KeyFuncs type in SimplerHash.
static int GetHashCode(FieldSeqNode fsn)
Expand Down Expand Up @@ -3244,6 +3260,13 @@ struct GenTreeField : public GenTree
gtFieldLookup.addr = nullptr;
#endif
}

// True if this field is a volatile memory operation.
bool IsVolatile() const
{
return (gtFlags & GTF_FLD_VOLATILE) != 0;
}

#if DEBUGGABLE_GENTREE
GenTreeField() : GenTree()
{
Expand Down Expand Up @@ -5038,6 +5061,18 @@ struct GenTreeIndir : public GenTreeOp
{
}

// True if this indirection is a volatile memory operation.
bool IsVolatile() const
{
return (gtFlags & GTF_IND_VOLATILE) != 0;
}

// True if this indirection is an unaligned memory operation.
bool IsUnaligned() const
{
return (gtFlags & GTF_IND_UNALIGNED) != 0;
}

#if DEBUGGABLE_GENTREE
protected:
friend GenTree;
Expand Down Expand Up @@ -5089,18 +5124,6 @@ struct GenTreeBlk : public GenTreeIndir
return (m_layout != nullptr) ? m_layout->GetSize() : 0;
}

// True if this BlkOpNode is a volatile memory operation.
bool IsVolatile() const
{
return (gtFlags & GTF_BLK_VOLATILE) != 0;
}

// True if this BlkOpNode is an unaligned memory operation.
bool IsUnaligned() const
{
return (gtFlags & GTF_BLK_UNALIGNED) != 0;
}

// Instruction selection: during codegen time, what code sequence we will be using
// to encode this operation.
enum
Expand Down
Loading

0 comments on commit 423c1eb

Please sign in to comment.