From 5687acf431de4f6a156b2f6906eb4eb503ac70ce Mon Sep 17 00:00:00 2001 From: Juneyoung Lee Date: Thu, 6 Feb 2020 06:41:58 +0900 Subject: [PATCH] [MemCpyOpt] Simplify find*Alignment --- llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp index fe7596f3bbe0..d9ff98d21c24 100644 --- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -146,13 +146,12 @@ bool MemsetRange::isProfitableToUseMemset(const DataLayout &DL) const { static Align findStoreAlignment(const DataLayout &DL, const StoreInst *SI) { - return DL.getValueOrABITypeAlignment(MaybeAlign(SI->getAlignment()), + return DL.getValueOrABITypeAlignment(SI->getAlign(), SI->getOperand(0)->getType()); } static Align findLoadAlignment(const DataLayout &DL, const LoadInst *LI) { - return DL.getValueOrABITypeAlignment(MaybeAlign(LI->getAlignment()), - LI->getType()); + return DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType()); } static Align findCommonAlignment(const DataLayout &DL, const StoreInst *SI,