[LLVMdev] mem2reg optimization

Chris Lattner clattner at apple.com
Mon Oct 27 00:08:56 PDT 2008

On Oct 26, 2008, at 11:09 PM, Chris Lattner wrote:
>> Fundamentally, we need a map from BasicBlock to a list of ordered
>> loads and
>> stores in that block.
> Are you seeing cases where lots of time is spent in
> RewriteSingleStoreAlloca[s]?  If so, please provide a testcase and I
> can apply the obvious fix.

Okay, I decided to just go ahead and make the change, with the  
justification that it is a significant code cleanup to mem2reg.   
Here's the patch:

Are there any other places which exhibit bad behavior with large  
blocks in mem2reg?  I see a linear scan over instructions in  
RenamePass.  If you can produce a testcase which shows a problem  
there, I'd be happy to help fix it.


More information about the llvm-dev mailing list