Fix Polly

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@375421 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/ScopBuilder.cpp b/lib/Analysis/ScopBuilder.cpp
index db7bea1..61efbef 100644
--- a/lib/Analysis/ScopBuilder.cpp
+++ b/lib/Analysis/ScopBuilder.cpp
@@ -2890,7 +2890,7 @@
 
   auto &DL = scop->getFunction().getParent()->getDataLayout();
   if (isSafeToLoadUnconditionally(LI->getPointerOperand(), LI->getType(),
-                                  LI->getAlignment(), DL)) {
+                                  MaybeAlign(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
@@ -2940,9 +2940,9 @@
 
   // TODO: We can provide more information for better but more expensive
   //       results.
-  if (!isDereferenceableAndAlignedPointer(LInst->getPointerOperand(),
-                                          LInst->getType(),
-                                          LInst->getAlignment(), DL))
+  if (!isDereferenceableAndAlignedPointer(
+          LInst->getPointerOperand(), LInst->getType(),
+          MaybeAlign(LInst->getAlignment()), DL))
     return false;
 
   // If the location might be overwritten we do not hoist it unconditionally.
diff --git a/lib/Analysis/ScopDetection.cpp b/lib/Analysis/ScopDetection.cpp
index da4b9bb..f57174f 100644
--- a/lib/Analysis/ScopDetection.cpp
+++ b/lib/Analysis/ScopDetection.cpp
@@ -468,8 +468,8 @@
 
     for (auto NonAffineRegion : Context.NonAffineSubRegionSet) {
       if (isSafeToLoadUnconditionally(Load->getPointerOperand(),
-                                      Load->getType(), Load->getAlignment(),
-                                      DL))
+                                      Load->getType(),
+                                      MaybeAlign(Load->getAlignment()), DL))
         continue;
 
       if (NonAffineRegion->contains(Load) &&