From: Xin Tong Date: Fri, 4 Jan 2019 02:13:22 +0000 (+0000) Subject: [memcpyopt] Remove a few unnecessary isVolatile() checks. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9ad64b2129fdf9aea1b5127b92342c04bc89a60;p=llvm [memcpyopt] Remove a few unnecessary isVolatile() checks. NFC We already checked for isSimple() on the store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350378 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 3315181c51d..2bdecb48446 100644 --- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -675,13 +675,11 @@ bool MemCpyOptPass::processStore(StoreInst *SI, BasicBlock::iterator &BBI) { if (UseMemMove) M = Builder.CreateMemMove( SI->getPointerOperand(), findStoreAlignment(DL, SI), - LI->getPointerOperand(), findLoadAlignment(DL, LI), Size, - SI->isVolatile()); + LI->getPointerOperand(), findLoadAlignment(DL, LI), Size); else M = Builder.CreateMemCpy( SI->getPointerOperand(), findStoreAlignment(DL, SI), - LI->getPointerOperand(), findLoadAlignment(DL, LI), Size, - SI->isVolatile()); + LI->getPointerOperand(), findLoadAlignment(DL, LI), Size); LLVM_DEBUG(dbgs() << "Promoting " << *LI << " to " << *SI << " => " << *M << "\n"); @@ -770,8 +768,8 @@ bool MemCpyOptPass::processStore(StoreInst *SI, BasicBlock::iterator &BBI) { if (!Align) Align = DL.getABITypeAlignment(T); IRBuilder<> Builder(SI); - auto *M = Builder.CreateMemSet(SI->getPointerOperand(), ByteVal, - Size, Align, SI->isVolatile()); + auto *M = + Builder.CreateMemSet(SI->getPointerOperand(), ByteVal, Size, Align); LLVM_DEBUG(dbgs() << "Promoting " << *SI << " to " << *M << "\n");