From fdf4c76ca0a73b0c753329eb59804617a6003256 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 28 Sep 2018 01:06:13 +0000 Subject: [ScalarizeMaskedMemIntrin] Fix the alignment calculation for the scalar stores of a masked store expansion. It should be the minimum of the original alignment and the scalar size. llvm-svn: 343284 --- llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp') diff --git a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp index 65787bfd862..33eeb1c5ff3 100644 --- a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp +++ b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp @@ -276,7 +276,7 @@ static void scalarizeMaskedStore(CallInst *CI) { } // Adjust alignment for the scalar instruction. - AlignVal = std::max(AlignVal, EltTy->getPrimitiveSizeInBits() / 8); + AlignVal = std::min(AlignVal, EltTy->getPrimitiveSizeInBits() / 8); // Bitcast %addr fron i8* to EltTy* Type *NewPtrType = EltTy->getPointerTo(cast(Ptr->getType())->getAddressSpace()); -- cgit v1.2.3