Fix getCommonType in a different way from the way I fixed it when
authorChandler Carruth <chandlerc@gmail.com>
Tue, 18 Sep 2012 17:49:37 +0000 (17:49 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 18 Sep 2012 17:49:37 +0000 (17:49 +0000)
commit7c8df7aa0c02908a29f0b5e6cfccb531dccdb96b
treea54dfe66dbe5b052adf406931110b7136dc4667d
parent3b682bdf671e5dd0eb70c0498ba18e5c08874fc9
Fix getCommonType in a different way from the way I fixed it when
working on FCA splitting. Instead of refusing to form a common type when
there are uses of a subsection of the alloca as well as a use of the
entire alloca, just skip the subsection uses and continue looking for
a whole-alloca use with a type that we can use.

This produces slightly prettier IR I think, and also fixes the other
failure in the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164146 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
test/Transforms/SROA/basictest.ll