[PATCH] D74854: AMDGPU/GlobalISel: Fix mishandling SGPR v2s16 add/sub/mul

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 10:58:15 PST 2020


arsenm created this revision.
arsenm added reviewers: nhaehnle, kerbowa, foad.
Herald added subscribers: hiraditya, t-tye, tpr, dstuttard, rovka, yaxunl, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

We weren't considering the packed case correctly, and this was passing
through to the selector. The selector only checked the size, so this
would incorrectly compile to a single 32-bit scalar add.

      

As usual, the LegalizerHelper is somewhat awkward to use from
applyMappingImpl. I think this is the first place we've needed
multi-step legalization here though.


https://reviews.llvm.org/D74854

Files:
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
  llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-scalar-packed.xfail.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-add.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-add.s16.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-add.s32.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-add.v2s16.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74854.245469.patch
Type: text/x-patch
Size: 14389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200219/d1e08cbd/attachment.bin>


More information about the llvm-commits mailing list