[LLVMdev] [global-isel] ABI lowering clarifications
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Aug 9 10:44:34 PDT 2013
On Aug 9, 2013, at 5:43 AM, Justin Holewinski <justin.holewinski at gmail.com> wrote:
>> Legalization
>>
>> SelectionDAG's concept of legal types isn't clearly defined. It seems to be a bit random which operations must be supported before a type can be considered legal. We'll define legal types precisely:
>>
>> A type is considered legal if it can be loaded into and stored from an allocatable register class. (And all allocatable register classes must support copy instructions.)
>>
> Does this definition require cross-class copies to be legal? If I have an i8 register class that only supports load/store, it seems like some way to copy it to a larger register to perform other operations would be needed. Or is it sufficient that the register class only support storing to the stack so the value can be ext-loaded to a larger register?
This is where the iterative legalization comes in. The legalizer would initially widen an i8 operation by using anyext/trunc operations which may not be legal. These operations may combine with loads and stores to form extload/truncstore, or they may be legalized some other way.
I imagine that anyext/trunc operations would also be pushed around the CFG, like the i64 type split in the second example in the proposal.
Thanks,
/jakob
More information about the llvm-dev
mailing list