[llvm-branch-commits] [llvm] AMDGPU: Implement isExtractVecEltCheap (PR #122460)

Joe Nash via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 14 11:19:35 PST 2025


================
@@ -1949,6 +1949,13 @@ bool SITargetLowering::isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
   return Index == 0;
 }
 
+bool SITargetLowering::isExtractVecEltCheap(EVT VT, unsigned Index) const {
+  // TODO: This should be more aggressive, particular for 16-bit element
+  // vectors. However there are some mixed improvements and regressions.
+  EVT EltTy = VT.getVectorElementType();
+  return EltTy.getSizeInBits() % 32 == 0;
----------------
Sisyph wrote:

Yes I would think EltTy.getSizeInBits() * Index % 16 == 0 for True16 would be the way to go.

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


More information about the llvm-branch-commits mailing list