Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Ensure morph and rationalize check OBJ(ADDR(CNS_VEC))
  • Loading branch information
tannergooding committed May 31, 2022
commit 67ceb71befd68a05b82a3c2a116c31f2be6b41c1
16 changes: 13 additions & 3 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,20 @@ void CallArgs::ArgsComplete(Compiler* comp, GenTreeCall* call)
#if defined(FEATURE_SIMD) && defined(TARGET_ARM64)
else if (isMultiRegArg && varTypeIsSIMD(argx->TypeGet()))
{
GenTree* nodeToCheck = argx;

if (nodeToCheck->OperIs(GT_OBJ))
{
nodeToCheck = nodeToCheck->AsObj()->gtOp1;

if (nodeToCheck->OperIs(GT_ADDR))
{
nodeToCheck = nodeToCheck->AsOp()->gtOp1;
}
}

// SIMD types do not need the optimization below due to their sizes
if (argx->OperIsSimdOrHWintrinsic() || argx->IsCnsVec() ||
(argx->OperIs(GT_OBJ) && argx->AsObj()->gtOp1->OperIs(GT_ADDR) &&
argx->AsObj()->gtOp1->AsOp()->gtOp1->OperIsSimdOrHWintrinsic()))
if (nodeToCheck->OperIsSimdOrHWintrinsic() || nodeToCheck->IsCnsVec())
{
SetNeedsTemp(&arg);
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/rationalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void Rationalizer::RewriteSIMDIndir(LIR::Use& use)
{
GenTree* location = addr->AsUnOp()->gtGetOp1();

if (location->OperIsSimdOrHWintrinsic())
if (location->OperIsSimdOrHWintrinsic() || location->IsCnsVec())
{
// If we have IND(ADDR(SIMD)) then we can keep only the SIMD node.
// This is a special tree created by impNormStructVal to preserve the class layout
Expand Down