diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-09-18 17:49:37 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-09-18 17:49:37 +0000 |
commit | 7c8df7aa0c02908a29f0b5e6cfccb531dccdb96b (patch) | |
tree | a54dfe66dbe5b052adf406931110b7136dc4667d /lib/Transforms | |
parent | 3b682bdf671e5dd0eb70c0498ba18e5c08874fc9 (diff) | |
download | external_llvm-7c8df7aa0c02908a29f0b5e6cfccb531dccdb96b.zip external_llvm-7c8df7aa0c02908a29f0b5e6cfccb531dccdb96b.tar.gz external_llvm-7c8df7aa0c02908a29f0b5e6cfccb531dccdb96b.tar.bz2 |
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/SROA.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index 3607d4c..c959560 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -1059,7 +1059,7 @@ Type *AllocaPartitioning::getCommonType(iterator I) const { if (isa<IntrinsicInst>(*UI->User)) continue; if (UI->BeginOffset != I->BeginOffset || UI->EndOffset != I->EndOffset) - return 0; + continue; Type *UserTy = 0; if (LoadInst *LI = dyn_cast<LoadInst>(&*UI->User)) { |