[PATCH] D36913: TableGen: Fix subreg composition/concatenation

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 18:59:44 PDT 2017


MatzeB created this revision.
Herald added subscribers: kristof.beyls, mcrosier, aemerson.

This fixes 2 problems in subregister hierarchies with multiple levels
and tuples:

1. For bigger tuples like computing secondary subregs would miss 2nd

order effects.  In the test case a register like `S10_S11_S12_S13_S14`
with https://reviews.llvm.org/D5 = S10_S11, https://reviews.llvm.org/D6 = S12_S13 we would correctly compute sub0 = https://reviews.llvm.org/D5,
sub1 = https://reviews.llvm.org/D6 but would miss the fact that we could now form
ssub0_ssub1_ssub2_ssub3 (aka sub0_sub1) = D5_D6. This is fixed by
changing computeSecondarySubRegs() to compute a fixpoint.

2. Fixing 1) exposed a problem where TableGen would create multiple

names for effectively the same subregister index. In the test case
the subregister index sub0 is composed from ssub0 and ssub1, and sub1 is
composed from ssub2 and ssub3. TableGen should not create both sub0_sub1
and ssub0_ssub1_ssub2_ssub3 as infered subregister indexes. This changes
the code to build a transitive closure of the subregister components
before forming new concatenated subregister indexes.

This fix was developed for an out of tree target. For the in-tree
targets the only change is in the register information computed for ARM.
There is a slight chance this fixed/improved some register coalescing
around the QQQQ/QQ register classes there but I couldn't see/provoke any
code generation differences.


Repository:
  rL LLVM

https://reviews.llvm.org/D36913

Files:
  test/TableGen/ConcatenatedSubregs.td
  utils/TableGen/CodeGenRegisters.cpp
  utils/TableGen/CodeGenRegisters.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36913.111790.patch
Type: text/x-patch
Size: 13511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170819/d8b86267/attachment.bin>


More information about the llvm-commits mailing list