[PATCH] D50725: [SystemZ] Replace subreg_r with subreg_h

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 10:34:53 PDT 2018


kparzysz added a comment.

The problem is in how tblgen calculates sub-registers. For a given register R, subreg indices of its sub-registers will be added to R, in other words a super-register "inherits" subreg indices from its subregisters.  For example, `V0` (from class `VR128`) has an explicit subreg index `subreg_h64`. It also has a sub-register `F0D`, which has a subreg index `subreg_h32`. As a result, V0 will have two subreg indices: `subreg_h64` and `subreg_h32`. From the register structure (`V0` vs `F0D` vs `F0S`) it is inferred that the composition `V0.subreg_h64.subreg_h32` is same as `V0.subreg_h32`, a in general that the composition `subreg_h64.subreg_h32` is equivalent to `subreg_h32`. At the same time, repeating this logic for a register `F0Q` from class `FPR128` leads to adding `subreg_h32` twice, which tblgen tries to resolve by referring to user-defined compositions. This is how `subreg_hh32` shows up. However, now there is another result for composing `subreg_h64.subreg_h32`, hence the warning.

This warning didn't exist back when the `subreg_r` was introduced, but that's because `VR128` didn't exist back then. If `subreg_r` was not added, adding `VR128` would cause the warning to appear.


Repository:
  rL LLVM

https://reviews.llvm.org/D50725





More information about the llvm-commits mailing list