]> granicus.if.org Git - llvm/commitdiff
[memcpyopt] Remove a few unnecessary isVolatile() checks. NFC
authorXin Tong <trent.xin.tong@gmail.com>
Fri, 4 Jan 2019 02:13:22 +0000 (02:13 +0000)
committerXin Tong <trent.xin.tong@gmail.com>
Fri, 4 Jan 2019 02:13:22 +0000 (02:13 +0000)
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

lib/Transforms/Scalar/MemCpyOptimizer.cpp

index 3315181c51d6d94b9ec8339dd35f54922cd3b6d2..2bdecb48446c421cd3b4baf81f7d6d79400123fd 100644 (file)
@@ -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");