[llvm-commits] [llvm] r154285 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp test/Transforms/InstCombine/alloca.ll

Chris Lattner clattner at apple.com
Mon Apr 9 10:11:49 PDT 2012


On Apr 8, 2012, at 7:36 AM, Chandler Carruth wrote:

> Author: chandlerc
> Date: Sun Apr  8 09:36:56 2012
> New Revision: 154285
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=154285&view=rev
> Log:
> Teach InstCombine to nuke a common alloca pattern -- an alloca which has
> GEPs, bit casts, and stores reaching it but no other instructions. These
> often show up during the iterative processing of the inliner, SROA, and
> DCE. Once we hit this point, we can completely remove the alloca. These
> were actually showing up in the final, fully optimized code in a bunch
> of inliner tests I've been working on, and notably they show up after
> LLVM finishes optimizing away all function calls involved in
> hash_combine(a, b).

This looks good to me.  One typo: "poniter".  Also you might want to handle memcpy to the alloca, which Clang generates for common C++ types, and memset for completeness.

-Chris




More information about the llvm-commits mailing list