Skip to content

Commit decda0b

Browse files
committed
Keep tracking SIMD flag in assertion
1 parent 025a959 commit decda0b

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/coreclr/jit/assertionprop.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
12481248
assertion.op2.u1.iconVal = op2->AsIntCon()->gtIconVal;
12491249
assertion.op2.vn = optConservativeNormalVN(op2);
12501250
assertion.op2.SetIconFlag(op2->GetIconHandleFlag());
1251+
assertion.op2.SetSimd(op2->IsCnsSimd());
12511252

12521253
//
12531254
// Ok everything has been set and the assertion looks good
@@ -1337,6 +1338,7 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
13371338

13381339
assertion.op2.u1.iconVal = iconVal;
13391340
assertion.op2.SetIconFlag(op2->GetIconHandleFlag(), op2->AsIntCon()->gtFieldSeq);
1341+
assertion.op2.SetSimd(op2->IsCnsSimd());
13401342
}
13411343
else if (op2->gtOper == GT_CNS_LNG)
13421344
{
@@ -3340,6 +3342,10 @@ GenTree* Compiler::optConstantAssertionProp(AssertionDsc* curAssertion,
33403342
{
33413343
assert(varTypeIsIntegralOrI(tree));
33423344
newTree->BashToConst(curAssertion->op2.u1.iconVal, genActualType(tree));
3345+
if (curAssertion->op2.IsSimd())
3346+
{
3347+
newTree->gtFlags |= GTF_ICON_SIMD_COUNT;
3348+
}
33433349
}
33443350
break;
33453351

src/coreclr/jit/compiler.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7830,6 +7830,7 @@ class Compiler
78307830
optOp2Kind kind; // a const or copy assertion
78317831
private:
78327832
uint16_t m_encodedIconFlags; // encoded icon gtFlags, don't use directly
7833+
bool m_isSimd;
78337834
public:
78347835
ValueNum vn;
78357836
struct IntVal
@@ -7871,6 +7872,14 @@ class Compiler
78717872
m_encodedIconFlags = flags >> iconMaskTzc;
78727873
u1.fieldSeq = fieldSeq;
78737874
}
7875+
bool IsSimd() const
7876+
{
7877+
return m_isSimd;
7878+
}
7879+
void SetSimd(bool simd)
7880+
{
7881+
m_isSimd = simd;
7882+
}
78747883
} op2;
78757884

78767885
bool IsCheckedBoundArithBound()

src/coreclr/jit/gentree.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,6 +2236,11 @@ struct GenTree
22362236
return (gtOper == GT_CNS_INT) ? (gtFlags & GTF_ICON_HDL_MASK) : GTF_EMPTY;
22372237
}
22382238

2239+
bool IsCnsSimd() const
2240+
{
2241+
return (gtOper == GT_CNS_INT) ? ((gtFlags & GTF_ICON_SIMD_COUNT) != 0) : false;
2242+
}
2243+
22392244
bool IsTlsIconHandle()
22402245
{
22412246
if (IsIconHandle())

0 commit comments

Comments
 (0)