Hi everyone, I'm looking through codes related to registered pressure tracking, mainly the source files 'RegisterPressure.h/cpp', 'MachineRegisterInfo.h/cpp', 'TargetRegisterInfo.h/cpp'. There is a concept I can hardly understand, the 'register pressure set'. Class 'TargetRegisterInfo' defines two virtual methods 'getRegClassPressureSets' and 'getRegUnitPressureSets' for querying but I don't see any subclasses overriding it. What's the meaning of the register pressure set? Anyone can give me some help? Thanks! Xing
Quentin Colombet via llvm-dev
2016-May-23 16:48 UTC
[llvm-dev] What's "register pressure set"
Hi Xing, The register pressure sets are basically concepts that tells you how may variables can live in register at the same time. This information is available for two different level of abstraction: per register class and per register unit. The register unit is the basic entity we use to represent a register. Tablegen generates all of that for you, so you do not need to worry about them. Cheers, -Quentin> On May 23, 2016, at 12:57 AM, Xing Su via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi everyone, > > I'm looking through codes related to registered pressure tracking, mainly the source files 'RegisterPressure.h/cpp', 'MachineRegisterInfo.h/cpp', 'TargetRegisterInfo.h/cpp'. > > There is a concept I can hardly understand, the 'register pressure set'. Class 'TargetRegisterInfo' defines two virtual methods 'getRegClassPressureSets' and 'getRegUnitPressureSets' for querying but I don't see any subclasses overriding it. > > What's the meaning of the register pressure set? Anyone can give me some help? > > Thanks! > > > Xing > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Matthias Braun via llvm-dev
2016-May-23 18:30 UTC
[llvm-dev] What's "register pressure set"
You can find some notes on how pressure sets are computed in the tablegen source. If you look for the code overriding the virtual functions, you can find that tablegen places the generated code in $BUILDDIR/lib/Target/XXX/XXXGenRegisterInfo.inc - Matthias> On May 23, 2016, at 9:48 AM, Quentin Colombet via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi Xing, > > The register pressure sets are basically concepts that tells you how may variables can live in register at the same time. > This information is available for two different level of abstraction: per register class and per register unit. The register unit is the basic entity we use to represent a register. > > Tablegen generates all of that for you, so you do not need to worry about them. > > Cheers, > -Quentin >> On May 23, 2016, at 12:57 AM, Xing Su via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> Hi everyone, >> >> I'm looking through codes related to registered pressure tracking, mainly the source files 'RegisterPressure.h/cpp', 'MachineRegisterInfo.h/cpp', 'TargetRegisterInfo.h/cpp'. >> >> There is a concept I can hardly understand, the 'register pressure set'. Class 'TargetRegisterInfo' defines two virtual methods 'getRegClassPressureSets' and 'getRegUnitPressureSets' for querying but I don't see any subclasses overriding it. >> >> What's the meaning of the register pressure set? Anyone can give me some help? >> >> Thanks! >> >> >> Xing >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> On May 23, 2016, at 12:57 AM, Xing Su via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi everyone, > > I'm looking through codes related to registered pressure tracking, mainly the source files 'RegisterPressure.h/cpp', 'MachineRegisterInfo.h/cpp', 'TargetRegisterInfo.h/cpp'. > > There is a concept I can hardly understand, the 'register pressure set'. Class 'TargetRegisterInfo' defines two virtual methods 'getRegClassPressureSets' and 'getRegUnitPressureSets' for querying but I don't see any subclasses overriding it. > > What's the meaning of the register pressure set? Anyone can give me some help?I wish this were better explained/presented in the interface. It's not really so complicated... Essentially, a register unit is the smallest granual in the target's register file. Some parts of wider registers may be addressed as smaller subregisters. A pressure set is an abstraction that allows the compiler to track the register usage across different register widths in machine independent code. Say I have a machine with two 64-bit registers: {R0, R1} And one of the registers can be addressed as two 32-bit registers: {R0L, R0H} You need two pressure sets to track usage: P32 and P64. limit(P32) = 2 limit(P64) = 4 That's not a typo. The 64-bit presure set is 4 deep, even though the machine only has two 64-bit registers. An assignment to a 64-bit register increments P64 by two units: R0 = ... // P64 += 2 An assignment to a 32-bit register increments both sets, each by one unit: R0L = ... // P32 += 1; P64 += 1 The LLVM implementation of all this is extraodinarilly complex because these pressure sets are inferred from arbitrary register definitions, subregister relations, and register classes. Preciselly tracking pressure using the pressure set abstraction can also be fairly expensive. -Andy> > Thanks! > > > Xing > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Maybe Matching Threads
- What's "register pressure set"
- [LLVMdev] MIPS Register Pressure Limit.
- Register pressure calculation in the machine scheduler and live-through registers
- [LLVMdev] Backend : What am I missing here
- Addressing TableGen's error "Ran out of lanemask bits" in order to use more than 32 subregisters per register