[all-commits] [llvm/llvm-project] a6cb92: [TableGen] Let -register-info-debug dump Offset/Si...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Sun Nov 20 11:52:34 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6cb924abcd852cc598d98936aa1c4d7c2e90845
      https://github.com/llvm/llvm-project/commit/a6cb924abcd852cc598d98936aa1c4d7c2e90845
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2022-11-20 (Sun, 20 Nov 2022)

  Changed paths:
    M llvm/test/TableGen/ConcatenatedSubregs.td
    M llvm/utils/TableGen/RegisterInfoEmitter.cpp

  Log Message:
  -----------
  [TableGen] Let -register-info-debug dump Offset/Size for each SubRegIndex

This patch adds dumping of the Offset and Size info for each
SubRegIndex printed when using
  llvm-tblgen -gen-register-info -register-info-debug

It also updates the ConcatenatedSubregs.td to check those printouts,
including some new subreg definitions that show short-comings in
how the size is calculated when concatenating subregisters and at
least one has an incomplete size (-1). Today TableGen will just add
sizes together, resulting in MCRegisterInfo::getSubRegIdxSize()
returning a value that isn't -1 even if the combined subregister size
is unknown.

Differential Revision: https://reviews.llvm.org/D138340


  Commit: 294fdd99039e90ff996124c7775ca1efdea15cc2
      https://github.com/llvm/llvm-project/commit/294fdd99039e90ff996124c7775ca1efdea15cc2
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2022-11-20 (Sun, 20 Nov 2022)

  Changed paths:
    M llvm/test/TableGen/ConcatenatedSubregs.td
    M llvm/utils/TableGen/CodeGenRegisters.cpp

  Log Message:
  -----------
  [TableGen] Fix SubRegIndex size computation for concatenated subregs of unknown size

When calculating the size of concatenated subregisters, and at least
one of the subregisters involved has an unknown size (-1), then the
concatenated size should be set to -1 as well.

This bug was found for an out-of-tree target.

Looking at lib/Target the only in-tree target that has a subregister
with unknown size is X86:
  X86RegisterInfo.td:  def sub_mask_0   : SubRegIndex<-1>;

But it looks like sub_mask_0 don't result in any concatenated subreg
index with faulty size if looking at X86SubRegIdxRanges[].

Differential Revision: https://reviews.llvm.org/D138341


  Commit: 1c308d6641735b51d511342bd0353093254579f1
      https://github.com/llvm/llvm-project/commit/1c308d6641735b51d511342bd0353093254579f1
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2022-11-20 (Sun, 20 Nov 2022)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

  Log Message:
  -----------
  [LV] Clean up LoopVectorizationCostModel::calculateRegisterUsage. NFC

Minor refactoring in LoopVectorizationCostModel::calculateRegisterUsage.

Also adding some FIXME:s related to what appears to be some short
comings related to how the register usage is calculated.

Differential Revision: https://reviews.llvm.org/D138342


Compare: https://github.com/llvm/llvm-project/compare/5b19463f1172...1c308d664173


More information about the All-commits mailing list