Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 399df33

Browse files
committed
[ARM64] Fix UnspillReg instruction generation
Fixes the runtime issues (#16359,#15389) seen with COMPlus_JitStressRegs=0x2* on ARM64.
1 parent 24b9b0d commit 399df33

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/jit/codegenlinear.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,15 @@ void CodeGen::genUnspillRegIfNeeded(GenTree* tree)
896896
inst_RV_TT(ins_Load(treeType, compiler->isSIMDTypeLocalAligned(lcl->gtLclNum)), dstReg, unspillTree);
897897
}
898898
#elif defined(_TARGET_ARM64_)
899-
var_types targetType = unspillTree->gtType;
900-
instruction ins = ins_Load(targetType, compiler->isSIMDTypeLocalAligned(lcl->gtLclNum));
901-
emitAttr attr = emitTypeSize(targetType);
902-
emitter* emit = getEmitter();
899+
var_types targetType = unspillTree->gtType;
900+
if (targetType != genActualType(varDsc->lvType) && !varTypeIsGC(targetType) && !varDsc->lvNormalizeOnLoad())
901+
{
902+
assert(!varTypeIsGC(varDsc));
903+
targetType = genActualType(varDsc->lvType);
904+
}
905+
instruction ins = ins_Load(targetType, compiler->isSIMDTypeLocalAligned(lcl->gtLclNum));
906+
emitAttr attr = emitTypeSize(targetType);
907+
emitter* emit = getEmitter();
903908

904909
// Fixes Issue #3326
905910
attr = varTypeIsFloating(targetType) ? attr : emit->emitInsAdjustLoadStoreAttr(ins, attr);

0 commit comments

Comments
 (0)