[PATCH] D110926: [GlobalISel] Support vectors in LegalizerHelper::narrowScalarMul

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 02:28:02 PDT 2021


Petar.Avramovic added a comment.

Afaik `%3:_(<2 x s32>), %4:_(<2 x s32>) = G_UNMERGE_VALUES %0:_(<2 x s64>)` is not yet defined to work like that and should probably be forbidden to make such instruction in builder. Only allow scalar split and vector split to elements or sub-vectors. 
Desired unmerge works if done step by step:

  %5:_(s64), %6:_(s64) = G_UNMERGE_VALUES %0:_(<2 x s64>)
  %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %5:_(s64)
  %9:_(s32), %10:_(s32) = G_UNMERGE_VALUES %6:_(s64)
  %3:_(<2 x s32>) = G_BUILD_VECTOR %5:_(s64), %7:_(s32)
  %4:_(<2 x s32>) = G_BUILD_VECTOR %6:_(s64), %8:_(s32)

Similar for merge: merge s64 elements first then build <2 x s64> vector.
But <2 x s32> instructions will be scalarized, bit shift packing into <2 x s16> is most probably slower.
Why not go with scalarize at the start?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110926/new/

https://reviews.llvm.org/D110926



More information about the llvm-commits mailing list