[PATCH] D11198: Avoid insertion sorting each new range in MemCpyOptimizer

Nick Lewycky nicholas at mxc.ca
Thu Jul 16 23:44:02 PDT 2015


nicholas added a subscriber: nicholas.
nicholas accepted this revision.
nicholas added a reviewer: nicholas.
This revision is now accepted and ready to land.

================
Comment at: lib/Transforms/Scalar/MemCpyOptimizer.cpp:255
@@ -261,3 +254,3 @@
   // to insert a new range.  Handle this now.
-  if (I == E || End < I->Start) {
+  if (I == Ranges.end() || End < I->Start) {
     MemsetRange &R = *Ranges.insert(I, MemsetRange());
----------------
Optional: consider hoisting "Ranges.end()" out to "range_iterator E = Ranges.end;". See http://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop .


Repository:
  rL LLVM

http://reviews.llvm.org/D11198







More information about the llvm-commits mailing list