OpaquePtr: Update polly's calls to Loads.h API
authorTim Northover <tnorthover@apple.com>
Tue, 9 Jul 2019 12:13:31 +0000 (12:13 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 9 Jul 2019 12:13:31 +0000 (12:13 +0000)
The Loads.h API changed so that a Type parameter is now mandatory in
preparation for pointer types being opaque. Unfortunately I don't build
polly routinely and it still had some uses. This just provides the
(obvious) load type in each case.

llvm-svn: 365470

polly/lib/Analysis/ScopBuilder.cpp
polly/lib/Analysis/ScopDetection.cpp

index 6b75a82..8ae29e2 100644 (file)
@@ -1435,8 +1435,8 @@ isl::set ScopBuilder::getNonHoistableCtx(MemoryAccess *Access,
   isl::set SafeToLoad;
 
   auto &DL = scop->getFunction().getParent()->getDataLayout();
-  if (isSafeToLoadUnconditionally(LI->getPointerOperand(), LI->getAlignment(),
-                                  DL)) {
+  if (isSafeToLoadUnconditionally(LI->getPointerOperand(), LI->getType(),
+                                  LI->getAlignment(), DL)) {
     SafeToLoad = isl::set::universe(AccessRelation.get_space().range());
   } else if (BB != LI->getParent()) {
     // Skip accesses in non-affine subregions as they might not be executed
@@ -1487,6 +1487,7 @@ bool ScopBuilder::canAlwaysBeHoisted(MemoryAccess *MA,
   // TODO: We can provide more information for better but more expensive
   //       results.
   if (!isDereferenceableAndAlignedPointer(LInst->getPointerOperand(),
+                                          LInst->getType(),
                                           LInst->getAlignment(), DL))
     return false;
 
index ebe70ef..da4b9bb 100644 (file)
@@ -468,7 +468,8 @@ bool ScopDetection::onlyValidRequiredInvariantLoads(
 
     for (auto NonAffineRegion : Context.NonAffineSubRegionSet) {
       if (isSafeToLoadUnconditionally(Load->getPointerOperand(),
-                                      Load->getAlignment(), DL))
+                                      Load->getType(), Load->getAlignment(),
+                                      DL))
         continue;
 
       if (NonAffineRegion->contains(Load) &&