[LLVMdev] Sparc back end fix

Timothy M Jones tjones1 at inf.ed.ac.uk
Mon Nov 22 11:01:30 PST 2010


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.




More information about the llvm-dev mailing list