Hi all, While profiling LLVM I noticed that a significant amount of time is spent in the RewriteSingleStoreAlloca function. Especially for fairly long basic blocks, linearly searching for uses before a store isn't fast. So I was wondering if there isn't a faster way to locate these uses? Are there any other known opportunities for optimization? I noticed that register allocation takes a big bite out of JIT compilation performance, and there's a big reliance on STL containers (which are often not as fast as specialized custom containers). Thanks, Nicolas Capens -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080811/bfb2dc9e/attachment.html>
On Aug 11, 2008, at 7:58 AM, Nicolas Capens wrote:> Hi all, > > While profiling LLVM I noticed that a significant amount of time is > spent in the RewriteSingleStoreAlloca function. Especially for > fairly long basic blocks, linearly searching for uses before a store > isn’t fast. So I was wondering if there isn’t a faster way to locate > these uses?This should be easy to fix, particularly if there are many "single store allocas" being accessed in the same block. The check is verifying that the store happens before any loads in the same block. Can you provide a .bc testcase please?> > Are there any other known opportunities for optimization? I noticed > that register allocation takes a big bite out of JIT compilation > performance, and there’s a big reliance on STL containers (which are > often not as fast as specialized custom containers).There are many possibilities and many people are working on reducing compile time. If you're hitting some very slow case, it is best to file a bugzilla with a testcase. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080811/d57ff6fe/attachment.html>
On Monday 11 August 2008 09:58, Nicolas Capens wrote:> Hi all, > > > > While profiling LLVM I noticed that a significant amount of time is spent > in the RewriteSingleStoreAlloca function. Especially for fairly long basic > blocks, linearly searching for uses before a store isn't fast. So I was > wondering if there isn't a faster way to locate these uses?YES! I just finished a patch 2 hours ago to fix this. I'll get it in ASAP. mem2reg totally dropped off the radar once I did this. -Dave
Hi Dave, Did that patch of yours ever make it into trunk? I can't seem to find any related checkin for PromoteMemoryToRegister.cpp. I've been doing some extra profiling lately and the RewriteSingleStoreAlloca function alone is taking a whopping 63% of execution time. Thanks! Nicolas -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of David Greene Sent: Monday, 11 August, 2008 23:05 To: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] mem2reg optimization On Monday 11 August 2008 09:58, Nicolas Capens wrote:> Hi all, > > > > While profiling LLVM I noticed that a significant amount of time is spent > in the RewriteSingleStoreAlloca function. Especially for fairly long basic > blocks, linearly searching for uses before a store isn't fast. So I was > wondering if there isn't a faster way to locate these uses?YES! I just finished a patch 2 hours ago to fix this. I'll get it in ASAP. mem2reg totally dropped off the radar once I did this. -Dave _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev