[PATCH] D109228: [AMDGPU][GlobalISel] Legalize G_MUL for non-standard types

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 06:04:33 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:552
+      .minScalar(0, S16)
+      .widenScalarToNextMultipleOf(0, 32)
+      .maxScalar(0, S32)
----------------
For this case (have 16 insts but no 16 bit packed insts) I think the order should be something like:
```
      .legalFor({S32, S16})
      .minScalar(0, S16)
      .scalarize(0)
      .widenScalarToNextMultipleOf(0, 32)
      .maxScalar(0, S32)
```
Otherwise v2s16 would be widened to v2s32 and then scalarized to s32. Instead we want to scalarize it to s16.


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

https://reviews.llvm.org/D109228



More information about the llvm-commits mailing list