summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-09-28 01:06:13 +0000
committerCraig Topper <craig.topper@intel.com>2018-09-28 01:06:13 +0000
commitfdf4c76ca0a73b0c753329eb59804617a6003256 (patch)
tree3714fa9bea31de5601ae6d9cfa449cc276fc09fe /llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
parent92b992164d66371fb9796bfee82c7dddb6f381f8 (diff)
downloadbcm5719-llvm-fdf4c76ca0a73b0c753329eb59804617a6003256.tar.gz
bcm5719-llvm-fdf4c76ca0a73b0c753329eb59804617a6003256.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp')
-rw-r--r--llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp2
1 files changed, 1 insertions, 1 deletions
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<PointerType>(Ptr->getType())->getAddressSpace());
OpenPOWER on IntegriCloud