[polly] Remove use of getWithSamePointeeType() (NFC)
authorNikita Popov <npopov@redhat.com>
Tue, 18 Jul 2023 09:52:27 +0000 (11:52 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 18 Jul 2023 09:52:27 +0000 (11:52 +0200)
polly/lib/CodeGen/BlockGenerators.cpp

index 4c13364..3de1781 100644 (file)
@@ -265,19 +265,7 @@ Value *BlockGenerator::generateLocationAccessed(
 
   if (AccessExpr) {
     AccessExpr = isl_ast_expr_address_of(AccessExpr);
-    auto Address = ExprBuilder->create(AccessExpr);
-
-    // Cast the address of this memory access to a pointer type that has the
-    // same element type as the original access, but uses the address space of
-    // the newly generated pointer.
-    auto OldPtrTy = ExpectedType->getPointerTo();
-    auto NewPtrTy = Address->getType();
-    OldPtrTy = PointerType::getWithSamePointeeType(
-        OldPtrTy, NewPtrTy->getPointerAddressSpace());
-
-    if (OldPtrTy != NewPtrTy)
-      Address = Builder.CreateBitOrPointerCast(Address, OldPtrTy);
-    return Address;
+    return ExprBuilder->create(AccessExpr);
   }
   assert(
       Pointer &&