LLVM: llvm::RegisterBankInfo::ValueMapping Struct Reference (original) (raw)
Helper struct that represents how a value is mapped through different register banks. More...
Helper struct that represents how a value is mapped through different register banks.
Note
: So far we do not have any users of the complex mappings (mappings with more than one partial mapping), but when we do, we would have needed to duplicate partial mappings. The alternative could be to use an array of pointers of partial mapping (i.e., PartialMapping **BreakDown) and duplicate the pointers instead.
E.g., Let say we have a 32-bit add and a <2 x 32-bit> vadd. We can expand the <2 x 32-bit> add into 2 x 32-bit add.
Currently the TableGen-like file would look like:
{0, 32, GPR},
{0, 32, GPR}, {32, 32, GPR},
{0, 64, VPR}
};
ValueMapping[] {
{&PartialMapping[0], 1},
{&PartialMapping[1], 2},
{&PartialMapping[3], 1}
};
Helper struct that represents how a value is partially mapped into a register.
ValueMapping()
The default constructor creates an invalid (isValid() == false) instance.
With the array of pointer, we would have:
{ 0, 32, GPR},
{32, 32, GPR},
{ 0, 64, VPR}
};
BreakDowns[] = {
&PartialMapping[0],
&PartialMapping[0], &PartialMapping[1],
&PartialMapping[2]
};
ValueMapping[] {
{&BreakDowns[0], 1},
{&BreakDowns[1], 2},
{&BreakDowns[3], 1}
};
Given that a PartialMapping is actually small, the code size impact is actually a degradation. Moreover the compile time will be hit by the additional indirection. If PartialMapping gets bigger we may reconsider.
Definition at line 146 of file RegisterBankInfo.h.