Teach InstCombine to nuke a common alloca pattern -- an alloca which has
authorChandler Carruth <chandlerc@gmail.com>
Sun, 8 Apr 2012 14:36:56 +0000 (14:36 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 8 Apr 2012 14:36:56 +0000 (14:36 +0000)
commit2450eca96061ddb1d9a62f42669184684476448a
treeb4271c7f495851218d1c7fe3d1e687cdf10951d7
parent9d68b06bc5ef1157d198d52e3f6829c721d72552
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154285 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/alloca.ll