Skip to content

Commit

Permalink
[JIT] On importing a CEE_INITOBJ for a simd, construct a VecCon(0) (#…
Browse files Browse the repository at this point in the history
…81982)

* On importing a CEE_INITOBJ for a simd, construct a VecCon(0) of that type

* Formatting

* Check layout to determine if type is a SIMD to avoid redundant impNormStructType call

* Fix assert

* Remove assert

* Update src/coreclr/jit/importer.cpp

Co-authored-by: SingleAccretion <[email protected]>

* Update importer.cpp

---------

Co-authored-by: SingleAccretion <[email protected]>
  • Loading branch information
TIHan and SingleAccretion authored Feb 23, 2023
1 parent a375009 commit c1abf87
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10605,25 +10605,35 @@ void Compiler::impImportBlockCode(BasicBlock* block)
goto EVAL_APPEND;

case CEE_INITOBJ:

{
assertImp(sz == sizeof(unsigned));

_impResolveToken(CORINFO_TOKENKIND_Class);

JITDUMP(" %08X", resolvedToken.token);

lclTyp = JITtype2varType(info.compCompHnd->asCorInfoType(resolvedToken.hClass));

ClassLayout* layout = nullptr;

if (lclTyp == TYP_STRUCT)
{
layout = typGetObjLayout(resolvedToken.hClass);
lclTyp = layout->GetType();
}

if (lclTyp != TYP_STRUCT)
{
op2 = gtNewZeroConNode(genActualType(lclTyp));
goto STIND_VALUE;
}

op1 = impPopStack().val;
op1 = gtNewStructVal(typGetObjLayout(resolvedToken.hClass), op1);
op1 = gtNewStructVal(layout, op1);
op2 = gtNewIconNode(0);
op1 = gtNewBlkOpNode(op1, op2, (prefixFlags & PREFIX_VOLATILE) != 0);
goto SPILL_APPEND;
}

case CEE_INITBLK:

Expand Down

0 comments on commit c1abf87

Please sign in to comment.