[PATCH] D44488: [llvm-mca] Refactor class RegisterFile to allow the definition of multiple register files.

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 12:15:08 PDT 2018


andreadb created this revision.
andreadb added reviewers: RKSimon, spatel, courbet.
Herald added subscribers: gbedwell, tschuett.

This is a refactoring in preparation for other two changes that will allow scheduling models to define multiple register files. This is the first step towards fixing PR36662.

class RegisterFile (in Dispatch.h) now can be used to emulate multiple register files.
Internally, it tracks the number of temporary registers dynamically allocated by each register file (described by class RegisterFileInfo).
A RegisterFileInfo stores the number of temporary registers available, and the maximum number of temporary registers used at runtime. There is a RegisterFileInfo for every register file defined by the processor scheduling model. In the absence of register file definitions, a "default" RegisterFileInfo is created; the default RegisterFileInfo describes a register file with an unlimited number of temporaries.

Each register file is associated with a list of MCRegisterClass indices. Knowinb the register class indices allows to map physical registers to register files.

The long term goal is to allow processor models to optionally specify how many register files are implemented using the following tablegen syntax:

  `def FPRegFile : RegisterFile<[RegisterClassA, RegisterClassB, ...], #NumTemps>`

Where: `[RegisterClassA, RegisterClassB,...]` is a list of RegisterClass records, and `#NumTemps` is the number of temporaries implemented by the register file.

This patch is a "NFCI" change that restructures the code in preparation for the future development to fix PR36662.
Once this patch is accepted, the plan is to send two other patches:

1. A patch that adds the new tablegen syntax for defining RegisterFiles
2. An llvm-mca patch that allows to query the model to obtain the register file descriptors.

Please let me know what you think.

Thanks,
Andrea


https://reviews.llvm.org/D44488

Files:
  tools/llvm-mca/Backend.cpp
  tools/llvm-mca/Dispatch.cpp
  tools/llvm-mca/Dispatch.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44488.138431.patch
Type: text/x-patch
Size: 20539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180314/bab1eaec/attachment.bin>


More information about the llvm-commits mailing list