ether zhhb
2009-Nov-17 12:48 UTC
[LLVMdev] LLVM target-independent code generator for reconfigurable logic
hi every one, i am use LLVM targeting a architecture with a processor and reconfigurable logic around it. now the llvm code generator work fine with the processor, but i am struggling to make the code generator to generate proper DAGs for the reconfigurable logic because "The LLVM target-independent code generator is designed to support efficient and quality code generation for standard register-based microprocessors.", so i want to insert my special DAG building code to the code generator. should i completely replace SelectionDAGISel, or modify SelectionDAGISel when necessary like this: LowerArguments(BasicBlock *LLVMBB) { // code for traditional target ........... for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I, ++Idx) { if (TLI.isStrangeTarget()) { //code for my strange target TLI.HandleArgment(...); continue; } // code for traditional target ....... } // code for traditional target ............. } thank you for any suggestion
Samuel Crow
2009-Nov-17 17:32 UTC
[LLVMdev] LLVM target-independent code generator for reconfigurable logic
Hello Ether, Yours isn't the first to target reconfigurable logic. I think http://www.c-to-verilog.com/ has a good example of going from a C compiler to reconfigurable logic. The usual way to lower to gate layout is to just lower the math operators to the equivalent use of an ALU and then optimize from there. Unfortunately for you, you'll need a modulo scheduler to make the code compile to raw gate layout with any reasonably acceptable level of optimization. Modulo schedulers are very processor intensive so you'll be adding minutes to the compile time and the results are only moderately good. I hope this helps, --Sam ----- Original Message ----> From: ether zhhb <etherzhhb at gmail.com> > To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > Sent: Tue, November 17, 2009 6:48:34 AM > Subject: [LLVMdev] LLVM target-independent code generator for reconfigurable logic > > hi every one, > > i am use LLVM targeting a architecture with a processor and > reconfigurable logic around it. > > now the llvm code generator work fine with the processor, but i am > struggling to make the code generator to generate proper DAGs for the > reconfigurable logic because "The LLVM target-independent code > generator is designed to support efficient and quality code generation > for standard register-based microprocessors.", so i want to insert my > special DAG building code to the code generator. > > should i completely replace SelectionDAGISel, or modify > SelectionDAGISel when necessary like this: > > LowerArguments(BasicBlock *LLVMBB) { > // code for traditional target > ........... > > for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); > I != E; ++I, ++Idx) { > > if (TLI.isStrangeTarget()) { > //code for my strange target > TLI.HandleArgment(...); > continue; > } > // code for traditional target > ....... > } > > // code for traditional target > ............. > > } > > > thank you for any suggestion
Reasonably Related Threads
- [LLVMdev] Referring to an argument in another function
- [LLVMdev] How to duplicate a function?
- [LLVMdev] Referring to an argument in another function
- [LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
- [LLVMdev] Patch: MSIL backend global pointers initialization