Hi all, We are developing our own compiler front-end and use LLVM as back-end. We generate .ll files and use opt/llc to generate target specific code. When I generate datalayout information in my .ll file it seems that it enables more optimization from LLVM opt. How can I determine which optimization are driven by datalayout information generation ? In other words, when I don't generate target specific datalayout information, what are the optimizations that are turned off ? Thanks for answers Best Regards Seb -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120416/ad5e18af/attachment.html>
Are you expecting to use a single set of IR files to generate code for multiple targets? Otherwise I'm not sure why your .ll files would necessarily lack the data layout information. The reason I ask is that LLVM IR is fundamentally not target independent in ways far beyond the presence or absence of the data layout string. For gory details: http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043719.html. Beyond that, rather large, caveat, I'm not sure of the answer to your specific question. It's not so much which optimizations are turned off, per se, but rather that some won't have the information they need (alignment data, for example) to do a good job, so they'll miss opportunities. Regards, Jim On Apr 16, 2012, at 9:06 AM, Sebastien DELDON-GNB <sebastien.deldon at st.com> wrote:> Hi all, > > We are developing our own compiler front-end and use LLVM as back-end. We generate .ll files and use opt/llc to generate target specific code. When I generate datalayout information in my .ll file it seems that it enables more optimization from LLVM opt. How can I determine which optimization are driven by datalayout information generation ? > In other words, when I don’t generate target specific datalayout information, what are the optimizations that are turned off ? > > Thanks for answers > Best Regards > Seb > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi Sebastien,> We are developing our own compiler front-end and use LLVM as back-end. We > generate .ll files and use opt/llc to generate target specific code. When I > generate datalayout information in my .ll file it seems that it enables more > optimization from LLVM opt. How can I determine which optimization are driven by > datalayout information generation ? > > In other words, when I don’t generate target specific datalayout information, > what are the optimizations that are turned off ?this will give you an idea: grep -l -r TargetData llvm/lib/Transforms Several of these work in a degraded mode if they don't have target data, i.e. they still do some optimizations, just not all of them. Finally, there are a few optimizations that could in theory be performed without target data but aren't because either no-one implemented it, or it is tricky and didn't seem worth it. Ciao, Duncan.
Hi Jim, First of all, thanks for the quick answer. I'm just asking this question because in presence of target specific 'datalayout' information I see significant speed-up on benchmarks, in certain rare cases I also see slowdowns. So before digging into the sources to understand what's going on, I wanted to understand if there is an identified set of optimizations that are known to benefit of 'datalayout' information. Best Regards Seb> -----Original Message----- > From: Jim Grosbach [mailto:grosbach at apple.com] > Sent: Tuesday, April 17, 2012 12:30 AM > To: Sebastien DELDON-GNB > Cc: llvmdev at cs.uiuc.edu > Subject: Re: [LLVMdev] datalayout optimization question > > Are you expecting to use a single set of IR files to generate code for > multiple targets? Otherwise I'm not sure why your .ll files would > necessarily lack the data layout information. The reason I ask is that > LLVM IR is fundamentally not target independent in ways far beyond the > presence or absence of the data layout string. > > For gory details: http://lists.cs.uiuc.edu/pipermail/llvmdev/2011- > October/043719.html. > > Beyond that, rather large, caveat, I'm not sure of the answer to your > specific question. It's not so much which optimizations are turned off, > per se, but rather that some won't have the information they need > (alignment data, for example) to do a good job, so they'll miss > opportunities. > > Regards, > Jim > > On Apr 16, 2012, at 9:06 AM, Sebastien DELDON-GNB > <sebastien.deldon at st.com> wrote: > > > Hi all, > > > > We are developing our own compiler front-end and use LLVM as back- > end. We generate .ll files and use opt/llc to generate target specific > code. When I generate datalayout information in my .ll file it seems > that it enables more optimization from LLVM opt. How can I determine > which optimization are driven by datalayout information generation ? > > In other words, when I don't generate target specific datalayout > information, what are the optimizations that are turned off ? > > > > Thanks for answers > > Best Regards > > Seb > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev