diff --git a/llvm/lib/SYCLLowerIR/LowerWGScope.cpp b/llvm/lib/SYCLLowerIR/LowerWGScope.cpp index 15fe4cc4ec6ac..197d01447b9a4 100644 --- a/llvm/lib/SYCLLowerIR/LowerWGScope.cpp +++ b/llvm/lib/SYCLLowerIR/LowerWGScope.cpp @@ -926,7 +926,7 @@ Value *spirv::genPseudoLocalID(Instruction &Before, const Triple &TT) { asUInt(spirv::AddrSpace::Global) // AddressSpace ); unsigned Align = M.getDataLayout().getPreferredAlignment(G); - G->setAlignment(Align); + G->setAlignment(MaybeAlign(Align)); } Value *Res = new LoadInst(G, "", &Before); return Res;