Skip to content
Merged
Prev Previous commit
Next Next commit
Delete now-unused SIMD cache entries
  • Loading branch information
SingleAccretion committed Apr 1, 2023
commit e629e10252349e556487a6ee24b7bddc67142f92
19 changes: 0 additions & 19 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8414,34 +8414,15 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

struct SIMDHandlesCache
{
// BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG
// NATIVEINT, NATIVEUINT, FLOAT, and DOUBLE
static const uint32_t SupportedTypeCount = 12;

// SIMD Types
CORINFO_CLASS_HANDLE VectorTHandles[SupportedTypeCount];

CORINFO_CLASS_HANDLE PlaneHandle;
CORINFO_CLASS_HANDLE QuaternionHandle;
CORINFO_CLASS_HANDLE Vector2Handle;
CORINFO_CLASS_HANDLE Vector3Handle;
CORINFO_CLASS_HANDLE Vector4Handle;
CORINFO_CLASS_HANDLE VectorHandle;
Comment on lines 8433 to 8438
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these ones need to stay?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it just for isOpaqueSIMDType? Is there a plan to also remove that somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it just for isOpaqueSIMDType?

Yep. No explicit plans for its removal currently, though one could certainly imagine rewriting it to not need the cached handles (e. g. a new getClassAttribs flag, or matching by name).


#ifdef FEATURE_HW_INTRINSICS
#if defined(TARGET_ARM64)
CORINFO_CLASS_HANDLE Vector64THandles[SupportedTypeCount];
#endif // defined(TARGET_ARM64)
CORINFO_CLASS_HANDLE Vector128THandles[SupportedTypeCount];
#if defined(TARGET_XARCH)
CORINFO_CLASS_HANDLE Vector256THandles[SupportedTypeCount];
CORINFO_CLASS_HANDLE Vector512THandles[SupportedTypeCount];
#endif // defined(TARGET_XARCH)
#endif // FEATURE_HW_INTRINSICS

SIMDHandlesCache()
{
assert(SupportedTypeCount == static_cast<uint32_t>(CORINFO_TYPE_DOUBLE - CORINFO_TYPE_BYTE + 1));
memset(this, 0, sizeof(*this));
}
};
Expand Down
25 changes: 0 additions & 25 deletions src/coreclr/jit/simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH
JITDUMP(" Found Vector<%s>\n", varTypeName(JitType2PreciseVarType(simdBaseJitType)));

size = getSIMDVectorRegisterByteLength();

uint32_t handleIndex = static_cast<uint32_t>(simdBaseJitType - CORINFO_TYPE_BYTE);
assert(handleIndex < SIMDHandlesCache::SupportedTypeCount);

m_simdHandleCache->VectorTHandles[handleIndex] = typeHnd;
break;
}

Expand Down Expand Up @@ -347,11 +342,6 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH
}

JITDUMP(" Found Vector64<%s>\n", varTypeName(JitType2PreciseVarType(simdBaseJitType)));

uint32_t handleIndex = static_cast<uint32_t>(simdBaseJitType - CORINFO_TYPE_BYTE);
assert(handleIndex < SIMDHandlesCache::SupportedTypeCount);

m_simdHandleCache->Vector64THandles[handleIndex] = typeHnd;
break;
}
#endif // TARGET_ARM64
Expand All @@ -372,11 +362,6 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH
}

JITDUMP(" Found Vector128<%s>\n", varTypeName(JitType2PreciseVarType(simdBaseJitType)));

uint32_t handleIndex = static_cast<uint32_t>(simdBaseJitType - CORINFO_TYPE_BYTE);
assert(handleIndex < SIMDHandlesCache::SupportedTypeCount);

m_simdHandleCache->Vector128THandles[handleIndex] = typeHnd;
break;
}

Expand All @@ -403,11 +388,6 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH
}

JITDUMP(" Found Vector256<%s>\n", varTypeName(JitType2PreciseVarType(simdBaseJitType)));

uint32_t handleIndex = static_cast<uint32_t>(simdBaseJitType - CORINFO_TYPE_BYTE);
assert(handleIndex < SIMDHandlesCache::SupportedTypeCount);

m_simdHandleCache->Vector256THandles[handleIndex] = typeHnd;
break;
}

Expand All @@ -433,11 +413,6 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH
}

JITDUMP(" Found Vector512<%s>\n", varTypeName(JitType2PreciseVarType(simdBaseJitType)));

uint32_t handleIndex = static_cast<uint32_t>(simdBaseJitType - CORINFO_TYPE_BYTE);
assert(handleIndex < SIMDHandlesCache::SupportedTypeCount);

m_simdHandleCache->Vector512THandles[handleIndex] = typeHnd;
break;
}
#endif // TARGET_XARCH
Expand Down