[Alignment] Fix polly build
git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@373199 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/BlockGenerators.cpp b/lib/CodeGen/BlockGenerators.cpp
index e152099..da9ed98 100644
--- a/lib/CodeGen/BlockGenerators.cpp
+++ b/lib/CodeGen/BlockGenerators.cpp
@@ -1061,7 +1061,7 @@
LoadInst *VecLoad =
Builder.CreateLoad(VectorPtr, Load->getName() + "_p_vec_full");
if (!Aligned)
- VecLoad->setAlignment(8);
+ VecLoad->setAlignment(Align(8));
if (NegativeStride) {
SmallVector<Constant *, 16> Indices;
@@ -1089,7 +1089,7 @@
Builder.CreateLoad(VectorPtr, Load->getName() + "_p_splat_one");
if (!Aligned)
- ScalarLoad->setAlignment(8);
+ ScalarLoad->setAlignment(Align(8));
Constant *SplatVector = Constant::getNullValue(
VectorType::get(Builder.getInt32Ty(), getVectorWidth()));
diff --git a/lib/CodeGen/IslNodeBuilder.cpp b/lib/CodeGen/IslNodeBuilder.cpp
index 13d6169..17e41b4 100644
--- a/lib/CodeGen/IslNodeBuilder.cpp
+++ b/lib/CodeGen/IslNodeBuilder.cpp
@@ -1213,7 +1213,8 @@
Ptr = Builder.CreatePointerCast(Ptr, Ty->getPointerTo(AS), Name + ".cast");
PreloadVal = Builder.CreateLoad(Ptr, Name + ".load");
if (LoadInst *PreloadInst = dyn_cast<LoadInst>(PreloadVal))
- PreloadInst->setAlignment(dyn_cast<LoadInst>(AccInst)->getAlignment());
+ PreloadInst->setAlignment(
+ MaybeAlign(dyn_cast<LoadInst>(AccInst)->getAlignment()));
// TODO: This is only a hot fix for SCoP sequences that use the same load
// instruction contained and hoisted by one of the SCoPs.