[LLVMdev] gfortran

Michael McCracken michael.mccracken at gmail.com
Thu Aug 31 11:36:09 PDT 2006


On 8/31/06, Chris Lattner <sabre at nondot.org> wrote:
> On Wed, 30 Aug 2006, Michael McCracken wrote:
> > Hi, in a thread this afternoon about compiling the Fortran SPEC2000 to
> > LLVM bytecode, Chris mentioned that it should be possible to compile
> > to LLVM with the gfortran front end, although no one has necessarily
> > tried it.
>
> Yup.
>
> > I was surprised (and happy) to hear this, as under the impression that
> > it would require a "complete rewrite of the gfortran backend" [1]. Now,
> > I probably misinterpreted that exchange, but it was the only public
> > record I could find of discussion about using LLVM and gfortran. What's
> > the difference between how it works now and what Steven Bosscher was
> > saying would be a huge job?
>
> This comment meant that a "complete rewrite" was needed to go from
> GFortran AST's directly to LLVM, without going through GENERIC/GIMPLE.  If
> you use GENERIC/GIMPLE (as we currently do) it should be straight-forward.

OK, I see.

> > Also, is there any rough idea of how far from working it might be - I
> > note that there's considerable room for interpretation in the phrasing
> > of "See what works and what doesn't, debug, fix, submit patch, repeat."
> > :)
>
> I don't know that anyone has tried it.  I'd suggest configuring llvm-gcc4
> with gfortran enabled, then try some simple fortran programs.  I expect
> that there are only minor corner cases missing, e.g. some forms of
> ARRAY_REF we don't implement or something.
>
> > The reason I'm asking is that if it sounds like something I'll be able
> > to make a dent in, I'm going to start on it first thing tomorrow
> > morning. Like it's my job.
>
> Very cool, that would certainly be welcome.

OK, I've started by pulling the latest LLVM CVS and gcc4 SVN.
It looks like building f95 requires GMP, so I'm working on that too.
I'll update again once I get it building.

Thanks,
-mike

-- 
Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/wp/



More information about the llvm-dev mailing list