Skip to content

Commit 5c9338e

Browse files
authored
Fix impSIMDMinMax (#1774)
When taking the no-AVX, no-SSE42 path, ensure that it calls `lvaSetStruct` before `gtNewLclvNode`. Fix #1667
1 parent 2fdc85d commit 5c9338e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/src/jit/simd.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1924,8 +1924,8 @@ GenTree* Compiler::impSIMDMinMax(SIMDIntrinsicID intrinsicId,
19241924
if ((op1->gtFlags & GTF_SIDE_EFFECT) != 0)
19251925
{
19261926
op1LclNum = lvaGrabTemp(true DEBUGARG("SIMD Min/Max"));
1927-
dupOp1 = gtNewLclvNode(op1LclNum, op1->TypeGet());
19281927
lvaSetStruct(op1LclNum, typeHnd, false);
1928+
dupOp1 = gtNewLclvNode(op1LclNum, op1->TypeGet());
19291929
op1Assign = gtNewTempAssign(op1LclNum, op1);
19301930
op1 = gtNewLclvNode(op1LclNum, op1->TypeGet());
19311931
}
@@ -1937,8 +1937,8 @@ GenTree* Compiler::impSIMDMinMax(SIMDIntrinsicID intrinsicId,
19371937
if ((op2->gtFlags & GTF_SIDE_EFFECT) != 0)
19381938
{
19391939
op2LclNum = lvaGrabTemp(true DEBUGARG("SIMD Min/Max"));
1940-
dupOp2 = gtNewLclvNode(op2LclNum, op2->TypeGet());
19411940
lvaSetStruct(op2LclNum, typeHnd, false);
1941+
dupOp2 = gtNewLclvNode(op2LclNum, op2->TypeGet());
19421942
op2Assign = gtNewTempAssign(op2LclNum, op2);
19431943
op2 = gtNewLclvNode(op2LclNum, op2->TypeGet());
19441944
}

0 commit comments

Comments
 (0)