Skip to content

Commit

Permalink
Ensure TYP_SIMD12 LclVar can be cloned in lowering
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed May 20, 2021
1 parent 765d171 commit d9bd42e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6507,9 +6507,16 @@ GenTree* Compiler::gtNewLclvNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSE
// should be able to remove this exception and handle the assignment mismatch in
// Lowering.
LclVarDsc* varDsc = lvaGetDesc(lnum);
#if FEATURE_SIMD
// We can additionally have a SIMD12 that was widened to a SIMD16, generally as part of lowering
assert((type == varDsc->lvType) || ((type == TYP_SIMD16) && (varDsc->lvType == TYP_SIMD12)) ||
(lvaIsImplicitByRefLocal(lnum) && fgGlobalMorph && (varDsc->lvType == TYP_BYREF)) ||
((varDsc->lvType == TYP_STRUCT) && (genTypeSize(type) == varDsc->lvExactSize)));
#else
assert((type == varDsc->lvType) ||
(lvaIsImplicitByRefLocal(lnum) && fgGlobalMorph && (varDsc->lvType == TYP_BYREF)) ||
((varDsc->lvType == TYP_STRUCT) && (genTypeSize(type) == varDsc->lvExactSize)));
#endif // FEATURE_SIMD
}
GenTree* node = new (this, GT_LCL_VAR) GenTreeLclVar(GT_LCL_VAR, type, lnum DEBUGARG(ILoffs));

Expand Down

0 comments on commit d9bd42e

Please sign in to comment.