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

Paul Sokolovsky pmiscml at gmail.com
Fri Feb 22 04:08:45 PST 2013


Hello,

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).


-- 
Best regards,
 Paul                          mailto:pmiscml at gmail.com



More information about the llvm-dev mailing list