[PATCH] D12063: [PM] Port ScalarEvolution to the new pass manager.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 19:08:39 PDT 2015


chandlerc added a comment.

Thanks all, submitting.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:8330
@@ +8329,3 @@
+  // memory.
+  Arg.BackedgeTakenCounts.clear();
+}
----------------
sanjoy wrote:
> Won't this happen as part of `BackedgeTakenCounts(std::move(Arg.BackedgeTakenCounts))`?
Yea, I've removed it.

Fundamentally, without this we are playing a bit fast and loose. It relies on a particular implementation of move construction. However, calling '.clear()' is not actually any better as it relies on the moved-from object supporting that method. =/ I intensely dislike C++'s move semantics because of this.

But I think the better compromise is to insist that move construction does actually clear the moved-from object.


http://reviews.llvm.org/D12063





More information about the llvm-commits mailing list