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
Fix the bug
Assertion propagation can replace a TYP_UBYTE field
in a field list with a TYP_INT constant, so LSRA
must use the actual field type when deciding whether
an internal register to allocate must be byteable.
  • Loading branch information
SingleAccretion committed Aug 15, 2021
commit b2a8d231ee02af65715f8ffa0ff193c2ed160ddd
8 changes: 4 additions & 4 deletions src/coreclr/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,10 @@ void Lowering::LowerPutArgStk(GenTreePutArgStk* putArgStk)
unsigned prevOffset = putArgStk->GetStackByteSize();
for (GenTreeFieldList::Use& use : fieldList->Uses())
{
GenTree* const fieldNode = use.GetNode();
const var_types fieldType = fieldNode->TypeGet();
const unsigned fieldOffset = use.GetOffset();
assert(fieldType != TYP_LONG);
GenTree* const fieldNode = use.GetNode();
const unsigned fieldOffset = use.GetOffset();

assert(!fieldNode->TypeIs(TYP_LONG));

// We can treat as a slot any field that is stored at a slot boundary, where the previous
// field is not in the same slot. (Note that we store the fields in reverse order.)
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/jit/lsraxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,18 +1501,18 @@ int LinearScan::BuildPutArgStk(GenTreePutArgStk* putArgStk)
for (GenTreeFieldList::Use& use : putArgStk->gtOp1->AsFieldList()->Uses())
{
GenTree* const fieldNode = use.GetNode();
const var_types fieldType = fieldNode->TypeGet();
const unsigned fieldOffset = use.GetOffset();
const var_types fieldType = use.GetType();

#ifdef TARGET_X86
assert(fieldType != TYP_LONG);
#endif // TARGET_X86

#if defined(FEATURE_SIMD)
// Note that we need to check the GT_FIELD_LIST type, not 'fieldType'. This is because the
// GT_FIELD_LIST will be TYP_SIMD12 whereas the fieldType might be TYP_SIMD16 for lclVar, where
// Note that we need to check the field type, not the type of the node. This is because the
// field type will be TYP_SIMD12 whereas the node type might be TYP_SIMD16 for lclVar, where
// we "round up" to 16.
if ((use.GetType() == TYP_SIMD12) && (simdTemp == nullptr))
if ((fieldType == TYP_SIMD12) && (simdTemp == nullptr))
{
simdTemp = buildInternalFloatRegisterDefForNode(putArgStk);
}
Expand Down