COWArrayOpt: ensure that we can hoist all address projections that we stripped.

This change is needed because we new consider index_addr as address projection in Projection.h
This commit is contained in:
Erik Eckstein
2016-01-27 09:04:45 -08:00
parent ae28353906
commit 905fd37b98
4 changed files with 46 additions and 6 deletions

View File

@@ -1433,7 +1433,7 @@ bool COWArrayOpt::hoistMakeMutable(ArraySemanticsCall MakeMutable) {
// We can hoist address projections (even if they are only conditionally
// executed).
auto ArrayAddrBase = stripAddressProjections(CurrentArrayAddr);
auto ArrayAddrBase = stripUnaryAddressProjections(CurrentArrayAddr);
SILBasicBlock *ArrayAddrBaseBB = ArrayAddrBase->getParentBB();
if (ArrayAddrBaseBB && !DomTree->dominates(ArrayAddrBaseBB, Preheader)) {