summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-09-28 03:35:37 +0000
committerCraig Topper <craig.topper@intel.com>2018-09-28 03:35:37 +0000
commitbb50c38635684a95979437c6ea511253ea843c1a (patch)
tree0ebb99bebe101e0e383cbb8fc051e81725be45ff /llvm/lib/CodeGen
parentcff420120f944b012850ba279f0ec50b72571aca (diff)
downloadbcm5719-llvm-bb50c38635684a95979437c6ea511253ea843c1a.tar.gz
bcm5719-llvm-bb50c38635684a95979437c6ea511253ea843c1a.zip
[ScalarizeMaskedMemIntrin] Use MinAlign to calculate alignment for the scalar load/stores to handle element types that are byte-sized but not powers of 2.
This pass doesn't handle non-byte sized types correctly at all, but at least we can make byte sized types work. llvm-svn: 343294
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
index 33eeb1c5ff3..1fb116e9b48 100644
--- a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
+++ b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
@@ -153,7 +153,7 @@ static void scalarizeMaskedLoad(CallInst *CI) {
}
// Adjust alignment for the scalar instruction.
- AlignVal = std::min(AlignVal, EltTy->getPrimitiveSizeInBits() / 8);
+ AlignVal = MinAlign(AlignVal, EltTy->getPrimitiveSizeInBits() / 8);
// Bitcast %addr fron i8* to EltTy*
Type *NewPtrType =
EltTy->getPointerTo(cast<PointerType>(Ptr->getType())->getAddressSpace());
@@ -276,7 +276,7 @@ static void scalarizeMaskedStore(CallInst *CI) {
}
// Adjust alignment for the scalar instruction.
- AlignVal = std::min(AlignVal, EltTy->getPrimitiveSizeInBits() / 8);
+ AlignVal = MinAlign(AlignVal, EltTy->getPrimitiveSizeInBits() / 8);
// Bitcast %addr fron i8* to EltTy*
Type *NewPtrType =
EltTy->getPointerTo(cast<PointerType>(Ptr->getType())->getAddressSpace());
OpenPOWER on IntegriCloud