[polly] Fix regression tests with POLLY_ENABLE_GPGPU_CODEGEN
authorEli Friedman <efriedma@quicinc.com>
Mon, 19 Jul 2021 01:37:05 +0000 (18:37 -0700)
committerEli Friedman <efriedma@quicinc.com>
Mon, 19 Jul 2021 01:43:01 +0000 (18:43 -0700)
Apparently there was a latent bug here.

polly/lib/CodeGen/BlockGenerators.cpp

index 946bc09..f8cc47c 100644 (file)
@@ -802,7 +802,8 @@ void BlockGenerator::generateScalarStores(
           // The new Val might have a different type than the old Val due to
           // ScalarEvolution looking through bitcasts.
           Address = Builder.CreateBitOrPointerCast(
-              Address, Val->getType()->getPointerTo());
+              Address, Val->getType()->getPointerTo(
+                           Address->getType()->getPointerAddressSpace()));
 
           Builder.CreateStore(Val, Address);
         });