[polly] Get rid of a couple uses of PointerType::getElementType().

This commit is contained in:
Eli Friedman 2021-07-18 13:50:07 -07:00
parent 68fa6f7c7c
commit 43705149ed
1 changed files with 4 additions and 5 deletions

View File

@ -278,8 +278,8 @@ Value *BlockGenerator::generateLocationAccessed(
// the newly generated pointer.
auto OldPtrTy = ExpectedType->getPointerTo();
auto NewPtrTy = Address->getType();
OldPtrTy = PointerType::get(OldPtrTy->getElementType(),
NewPtrTy->getPointerAddressSpace());
OldPtrTy = PointerType::getWithSamePointeeType(
OldPtrTy, NewPtrTy->getPointerAddressSpace());
if (OldPtrTy != NewPtrTy)
Address = Builder.CreateBitOrPointerCast(Address, OldPtrTy);
@ -801,7 +801,6 @@ void BlockGenerator::generateScalarStores(
// The new Val might have a different type than the old Val due to
// ScalarEvolution looking through bitcasts.
if (Val->getType() != Address->getType()->getPointerElementType())
Address = Builder.CreateBitOrPointerCast(
Address, Val->getType()->getPointerTo());