[LLVMdev] LLVM Newbie. Questions about backend.

Sami Ahlberg sami.ahlberg at tut.fi
Fri Oct 26 02:52:01 PDT 2007


Hello,
I have been studying LLVM and started to create a new backend for a  
new RISC architecture. Now I need some help to get forward with my  
project. I'm quite new to compiling techniques so I'm sorry for the  
stupid questions.

Question 1:
My idea is to lower the select SDNode as follows:

%res1 = %falseVal
%res2 = setc %trueVal, %condition

Where setc is conditional mov. The question is how can I make sure  
that %res1 and %res2 are assigned to the same phsyical register? (I'm  
assuming you can only define virtual register once, is this correct  
assumption?)

Question 2:
What kind of information if any the front end needs about the target  
architecture? Am I able to use gcc front end to compile for the new  
architecture and what if there are 32- and 64-bit versions of the  
architecture? Is there an alternative front end and how does that  
handle the same issues?


Thank you very much in advance for your answers,

Sami






More information about the llvm-dev mailing list