Triple Yang
2012-Jun-23 08:36 UTC
[LLVMdev] Why can not sparcv9 backend handle i64 produced by FrameIndex?
Hi, all, I have been recently porting a backend for our experimental DSP. It has a regular register file for ALU, naming it R registers, and another register file (J registers) for memory access. Both R registers and J registers are 32-bit. Since LLVM cannot distinguish 32-bit integers or pointers during register allocation, I have to define J as 64-bit, although it's physically 32-bit. This is a rude and dirty trick. I define my TargetData as "e-p:64:64:64-i32:32:32-f32:32:32-n32". When storing a register to stack frame, 'store' node take a FrameIndex as an input node, where FrameIndex produces a 64-bit operand for 'store'. In legalization phase, llc comes into a problem saying: ExpandIntegerResult #0: 0xadb1888: i64 = FrameIndex<1> [ORD=2] [ID=0] Do not know how to expand the result of this operator! To sovle this problem, I tried "-march=sparcv9" (LLVM 3.1 release version), the same problem occured. sparcv9 is a 64-bit target so FrameIndex operator produces i64 data, and it seems v9 subtarget did not handle this well. Then I tried llc option "-march=x86-64 -view-dag-combine1-dags". It works OK. FrameIndex produces i64 in x86-64, but this subtarget can handle the problem well. So I guess hacking x86-64 backend will help me to find a solution. But I need more clues. Can someone tell me where to start? Best regards. -- æšćć (Yang Yongyong)