Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4938,6 +4938,7 @@ class Compiler
#define LPFLG_VAR_LIMIT 0x0100 // iterator is compared with a local var (var # found in lpVarLimit)
#define LPFLG_CONST_LIMIT 0x0200 // iterator is compared with a constant (found in lpConstLimit)
#define LPFLG_ARRLEN_LIMIT 0x0400 // iterator is compared with a.len or a[i].len (found in lpArrLenLimit)
#define LPFLG_SIMD_LIMIT 0x0080 // iterator is compared with Vector<T>.Count (found in lpConstLimit)

#define LPFLG_HAS_PREHEAD 0x0800 // lpHead is known to be a preHead for this loop
#define LPFLG_REMOVED 0x1000 // has been removed from the loop table (unrolled or optimized away)
Expand Down
7 changes: 7 additions & 0 deletions src/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10716,6 +10716,13 @@ void Compiler::gtDispConst(GenTree* tree)
printf(" field offset");
}

#ifdef FEATURE_SIMD
if ((tree->gtFlags & GTF_ICON_SIMD_COUNT) != 0)
{
printf(" Vector<T>.Count");
}
#endif

if ((tree->IsReuseRegVal()) != 0)
{
printf(" reuse reg val");
Expand Down
2 changes: 2 additions & 0 deletions src/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,8 @@ struct GenTree

#define GTF_ICON_FIELD_OFF 0x08000000 // GT_CNS_INT -- constant is a field offset

#define GTF_ICON_SIMD_COUNT 0x04000000 // GT_CNS_INT -- constant is Vector<T>.Count

#define GTF_BLK_VOLATILE 0x40000000 // GT_ASG, GT_STORE_BLK, GT_STORE_OBJ, GT_STORE_DYNBLK
// -- is a volatile block operation
#define GTF_BLK_UNALIGNED 0x02000000 // GT_ASG, GT_STORE_BLK, GT_STORE_OBJ, GT_STORE_DYNBLK
Expand Down
4 changes: 4 additions & 0 deletions src/jit/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,10 @@ bool Compiler::optCheckIterInLoopTest(
if (limitOp->gtOper == GT_CNS_INT)
{
optLoopTable[loopInd].lpFlags |= LPFLG_CONST_LIMIT;
if ((limitOp->gtFlags & GTF_ICON_SIMD_COUNT) != 0)
{
optLoopTable[loopInd].lpFlags |= LPFLG_SIMD_LIMIT;
}
}
else if (limitOp->gtOper == GT_LCL_VAR && !optIsVarAssigned(from, to, nullptr, limitOp->gtLclVarCommon.gtLclNum))
{
Expand Down
2 changes: 2 additions & 0 deletions src/jit/simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1812,6 +1812,8 @@ GenTreePtr Compiler::impSIMDIntrinsic(OPCODE opcode,
int length = getSIMDVectorLength(clsHnd);
GenTreeIntCon* intConstTree = new (this, GT_CNS_INT) GenTreeIntCon(TYP_INT, length);
retVal = intConstTree;

intConstTree->gtFlags |= GTF_ICON_SIMD_COUNT;
}
break;

Expand Down