Hi everyone, Following my earlier posting (http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-November/036292.html), I sent another message to the list, but it seems like it didn't get through :-( I managed to fix the problem in my earlier post and compile a cross-llvm-gcc. Then I discovered I was having problems with a setting a variable based on a ?: condition. Anyway, I've managed to track down the problem which was due to the conditional move not declaring its implicit use of the icc register in the back end. The following patch fixes this problem. A test case is also provided here too. Cheers Tim -- Timothy M. Jones http://homepages.inf.ed.ac.uk/tjones1 The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -------------- next part -------------- A non-text attachment was scrubbed... Name: sparc-cc.patch Type: application/octet-stream Size: 2495 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101122/fd0e0ed2/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: test-if.c Type: application/octet-stream Size: 306 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101122/fd0e0ed2/attachment-0001.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: test-if.sparc.bc Type: application/octet-stream Size: 872 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101122/fd0e0ed2/attachment-0002.obj>
Hi Tim, Thanks for the patch. I had a few questions though - just to make sure that I get the problem correctly. Currently, here is your flow, as I understand it : x86 llvm-gcc binary llc -march=sparc gcc cross/sparc source ---------------------> .bc ------------------> .s -----------------> sparc executable. Is this correct? Or did you manage to build the llvm-gcc source on a sparc machine? Also, does your flow work correctly for programs with C++ constructs (take any standard benchmark...e.g. PARSEC's streamcluster.cpp as an example program)? The reason I am asking this is because I partly succeeded in building the llvm-gcc frontend on a SPARC machine..which works fine for C programs. However, programs which involve C++ constructs do not succeed. Although I am yet to figure out the reason, I wanted to know if you ran into similar problems. Thanks. Raghu. ----- Original Message ----- From: "Timothy M Jones" <tjones1 at inf.ed.ac.uk> To: LLVMdev at cs.uiuc.edu Sent: Monday, November 22, 2010 10:04:57 AM Subject: [LLVMdev] Sparc back end fix Hi everyone, Following my earlier posting (http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-November/036292.html), I sent another message to the list, but it seems like it didn't get through :-( I managed to fix the problem in my earlier post and compile a cross-llvm-gcc. Then I discovered I was having problems with a setting a variable based on a ?: condition. Anyway, I've managed to track down the problem which was due to the conditional move not declaring its implicit use of the icc register in the back end. The following patch fixes this problem. A test case is also provided here too. Cheers Tim -- Timothy M. Jones http://homepages.inf.ed.ac.uk/tjones1 The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi Raghu, So, I managed to get a cross-llvm-gcc compiled. It runs on x86_64-linux and produces code for sparc-solaris. So my compilation flow is this: cross-llvm-gcc (source -> .bc) llc -march=sparc -mcpu=v9 (.bc -> .s) cross-gcc (.s -> sparc binary) I haven't yet tried to get c++ programs working. I'm trying to compile parsec but due to the ?: problem, failed at blackscholes. Now that this seems to work, I'm going to try all c programs before moving onto c++. I'll keep you posted if I have success or failure with these. Cheers Tim On Mon, 22 Nov 2010 13:27:09 -0500, Raghu Prabhakar <raghu at cs.ucla.edu> wrote:> Hi Tim, > > Thanks for the patch. I had a few questions though - just to make sure > that I get the problem correctly. Currently, here is your flow, as I > understand it : > > x86 llvm-gcc binary llc -march=sparc gcc cross/sparc > source ---------------------> .bc ------------------> .s > -----------------> sparc executable. > > Is this correct? Or did you manage to build the llvm-gcc source on a > sparc machine? > > Also, does your flow work correctly for programs with C++ constructs > (take any standard benchmark...e.g. PARSEC's streamcluster.cpp as an > example program)? The reason I am asking this is because I partly > succeeded in building the llvm-gcc frontend on a SPARC machine..which > works fine for C programs. However, programs which involve C++ > constructs do not succeed. Although I am yet to figure out the reason, I > wanted to know if you ran into similar problems. > > Thanks. > Raghu. > > > ----- Original Message ----- > From: "Timothy M Jones" <tjones1 at inf.ed.ac.uk> > To: LLVMdev at cs.uiuc.edu > Sent: Monday, November 22, 2010 10:04:57 AM > Subject: [LLVMdev] Sparc back end fix > > Hi everyone, > > Following my earlier posting > (http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-November/036292.html), I > sent another message to the list, but it seems like it didn't get through > :-( I managed to fix the problem in my earlier post and compile a > cross-llvm-gcc. Then I discovered I was having problems with a setting a > variable based on a ?: condition. Anyway, I've managed to track down the > problem which was due to the conditional move not declaring its implicit > use of the icc register in the back end. The following patch fixes this > problem. A test case is also provided here too. > > Cheers > Tim > >-- Timothy M. Jones http://homepages.inf.ed.ac.uk/tjones1 The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
On Nov 22, 2010, at 10:04 AM, Timothy M Jones wrote:> Hi everyone, > > Following my earlier posting (http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-November/036292.html), I sent another message to the list, but it seems like it didn't get through :-( I managed to fix the problem in my earlier post and compile a cross-llvm-gcc. Then I discovered I was having problems with a setting a variable based on a ?: condition. Anyway, I've managed to track down the problem which was due to the conditional move not declaring its implicit use of the icc register in the back end. The following patch fixes this problem. A test case is also provided here too.Sounds good, I'm happy to apply it if you think it's the right patch. Please convert the testcase to filecheck style like test/CodeGen/SPARC/basictest.ll on mainline. Thanks! -Chris