[llvm] [AMDGPU] Add folding ISD::SELECT from vXiY into vZi32 with X * Y = Z * 32 (PR #173328)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 09:08:59 PDT 2026


================
@@ -59,6 +59,26 @@ EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, ElementCount EC) {
   return ResultVT;
 }
 
+EVT EVT::getIntegerVectorWithElementWidth(LLVMContext &Context,
+                                          unsigned NewEltWidth) const {
+  if (!isVector() || !isInteger() || isScalableVector())
+    return EVT();
+
+  TypeSize TotalBits =
+      TypeSize::getFixed(getVectorMinNumElements() * getScalarSizeInBits());
+  if (TotalBits % NewEltWidth != 0 || NewEltWidth > TotalBits)
----------------
arsenm wrote:

Use isKnownMultipleOf

https://github.com/llvm/llvm-project/pull/173328


More information about the llvm-commits mailing list