[PATCH] D100708: GlobalISel: Relax verification of physical register copy types

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 17 09:59:15 PDT 2021


arsenm created this revision.
arsenm added reviewers: qcolombet, paquette, aemerson, bogner.
Herald added subscribers: pengfei, hiraditya, tpr, rovka.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This was picking a concrete size for a physical register, and
enforcing exact match on the virtual register's type size. Some
targets add multiple types to a register class, and some are smaller
than the full bit width. For example x86 adds f32 to 128-bit xmm
registers, and AMDGPU adds i16/f16 to 32-bit registers.

      

It might be better to represent these cases as a copy of the full
register and an extraction of the subpart, but a lot of code assumes
you can directly copy. This will help fix the current usage of the DAG
calling convention infrastructure which is incompatible with how
GlobalISel is now using it.

      

The API is somewhat cumbersome here, but I just mirrored the existing
functions, except now with LLTs (and allow returning null on failure,
unlike the MVT version). I think the concept of selecting register
classes based on type is flawed to begin with, but I'm trying to keep
this compatible with the existing handling.


https://reviews.llvm.org/D100708

Files:
  llvm/include/llvm/CodeGen/TargetRegisterInfo.h
  llvm/lib/CodeGen/MachineVerifier.cpp
  llvm/lib/CodeGen/TargetRegisterInfo.cpp
  llvm/test/MachineVerifier/test_copy_physregs_x86.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100708.338318.patch
Type: text/x-patch
Size: 7336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210417/97d1c241/attachment.bin>


More information about the llvm-commits mailing list