[LLVMdev] At which point application vs target machine type width splitting happens?

Duncan Sands baldrick at free.fr
Fri Feb 22 04:47:34 PST 2013


Hi Paul, this is done by the type legalizer, which lives in the files
   lib/CodeGen/SelectionDAG/Legalize*Types*

Ciao, Duncan.

> I'm trying to understand how fitting source integer type width into
> target machine register width happens. My reading on LLVM
> codegeneration topics (few megabytes) so far didn't have this topic
> mentioned explicitly.
>
> As an example, how
>
>    %1 = add nsw i32 %b, %a
>
> gets compiled into msp430 (16bit CPU) assembly as:
>
> 	add.w	r13, r15
> 	addc.w	r12, r14
>
> Using -print-before-all -print-after-all, I see that width splitting
> happens between last LLVM IR pass and first DAG pass dump. Using
> -view-* doesn't give insight either. Nor I was able to find any
> adhoc rules related to addc instruction in MSP430InstrInfo.td .
>
> So, it seems to be handled somewhere in target-independent code
> generator, can someone give a pointer to the code (and docs on this
> specific matter if any, because that's rather important machine-specific
> optimization topic IMHO, if you step aside from 32bit world).
>
>




More information about the llvm-dev mailing list