[llvm] r290692 - Revert "[NewGVN] replace emplace_back with push_back"

Piotr Padlewski via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 15:24:02 PST 2016


Author: prazek
Date: Wed Dec 28 17:24:02 2016
New Revision: 290692

URL: http://llvm.org/viewvc/llvm-project?rev=290692&view=rev
Log:
Revert "[NewGVN] replace emplace_back with push_back"

Modified:
    llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=290692&r1=290691&r2=290692&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Wed Dec 28 17:24:02 2016
@@ -277,7 +277,7 @@ private:
   // Congruence class handling.
   CongruenceClass *createCongruenceClass(Value *Leader, const Expression *E) {
     auto *result = new CongruenceClass(NextCongruenceNum++, Leader, E);
-    CongruenceClasses.push_back(result);
+    CongruenceClasses.emplace_back(result);
     return result;
   }
 
@@ -589,7 +589,7 @@ const Expression *NewGVN::createExpressi
 
     SmallVector<Constant *, 8> C;
     for (Value *Arg : E->operands())
-      C.push_back(cast<Constant>(Arg));
+      C.emplace_back(cast<Constant>(Arg));
 
     if (Value *V = ConstantFoldInstOperands(I, C, *DL, TLI))
       if (const Expression *SimplifiedE = checkSimplificationResults(E, I, V))
@@ -1256,12 +1256,12 @@ std::pair<unsigned, unsigned> NewGVN::as
   unsigned End = Start;
   if (MemoryAccess *MemPhi = MSSA->getMemoryAccess(B)) {
     InstrDFS[MemPhi] = End++;
-    DFSToInstr.push_back(MemPhi);
+    DFSToInstr.emplace_back(MemPhi);
   }
 
   for (auto &I : *B) {
     InstrDFS[&I] = End++;
-    DFSToInstr.push_back(&I);
+    DFSToInstr.emplace_back(&I);
   }
 
   // All of the range functions taken half-open ranges (open on the end side).
@@ -1585,7 +1585,7 @@ void NewGVN::convertDenseToDFSOrdered(Co
     else
       llvm_unreachable("Should have been an instruction");
 
-    DFSOrderedSet.push_back(VD);
+    DFSOrderedSet.emplace_back(VD);
 
     // Now add the users.
     for (auto &U : D->uses()) {
@@ -1606,7 +1606,7 @@ void NewGVN::convertDenseToDFSOrdered(Co
         VD.DFSIn = DFSPair.first;
         VD.DFSOut = DFSPair.second;
         VD.U = &U;
-        DFSOrderedSet.push_back(VD);
+        DFSOrderedSet.emplace_back(VD);
       }
     }
   }
@@ -1695,7 +1695,7 @@ public:
   std::pair<int, int> dfs_back() const { return DFSStack.back(); }
 
   void push_back(Value *V, int DFSIn, int DFSOut) {
-    ValueStack.push_back(V);
+    ValueStack.emplace_back(V);
     DFSStack.emplace_back(DFSIn, DFSOut);
   }
   bool empty() const { return DFSStack.empty(); }




More information about the llvm-commits mailing list