From: Guillaume Chatelet Date: Fri, 10 Jun 2022 15:20:07 +0000 (+0000) Subject: [NFC][Alignment] Simplify code X-Git-Tag: upstream/15.0.7~5189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc9c2eac987b7a8828b66d9d78ff286c478ca872;p=platform%2Fupstream%2Fllvm.git [NFC][Alignment] Simplify code --- diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index 671a5bc..759d724 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -274,7 +274,7 @@ Instruction *InstCombinerImpl::SimplifyAnyMemSet(AnyMemSetInst *MI) { return nullptr; const uint64_t Len = LenC->getLimitedValue(); assert(Len && "0-sized memory setting should be removed already."); - const Align Alignment = assumeAligned(MI->getDestAlignment()); + const Align Alignment = MI->getDestAlign().valueOrOne(); // If it is an atomic and alignment is less than the size then we will // introduce the unaligned memory access which will be later transformed diff --git a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp index 1659532..5eefde2 100644 --- a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp +++ b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp @@ -1021,8 +1021,7 @@ static bool handleMemIntrinsicPtrUse(MemIntrinsic *MI, Value *OldV, MDNode *NoAliasMD = MI->getMetadata(LLVMContext::MD_noalias); if (auto *MSI = dyn_cast(MI)) { - B.CreateMemSet(NewV, MSI->getValue(), MSI->getLength(), - MaybeAlign(MSI->getDestAlignment()), + B.CreateMemSet(NewV, MSI->getValue(), MSI->getLength(), MSI->getDestAlign(), false, // isVolatile TBAA, ScopeMD, NoAliasMD); } else if (auto *MTI = dyn_cast(MI)) { diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 7a62a3b..6d4c675 100644 --- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -994,9 +994,8 @@ bool LoopIdiomRecognize::processLoopMemSet(MemSetInst *MSI, SmallPtrSet MSIs; MSIs.insert(MSI); return processLoopStridedStore(Pointer, SE->getSCEV(MSI->getLength()), - MaybeAlign(MSI->getDestAlignment()), - SplatValue, MSI, MSIs, Ev, BECount, - IsNegStride, /*IsLoopMemset=*/true); + MSI->getDestAlign(), SplatValue, MSI, MSIs, Ev, + BECount, IsNegStride, /*IsLoopMemset=*/true); } /// mayLoopAccessLocation - Return true if the specified loop might access the