[PATCH] D44132: [MIR] Making MIR Printing, opt -dot-cfg, and -debug printing faster

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 12:13:33 PDT 2018


rtereshin added inline comments.


================
Comment at: lib/IR/AsmWriter.cpp:511
+    assert(P.second < NumberedTypes.size() && "Didn't get a dense numbering?");
+    assert(!NumberedTypes[P.second] && "Didn't get a unique numbering?");
+    NumberedTypes[P.second] = P.first;
----------------
bogner wrote:
> I think you can avoid default constructing the item by using NumberedTypes.count(P.second) instead of operator[]. Of course, it really doesn't matter much in this case since the value's just an unsigned.
`NumberedTypes` is a vector


Repository:
  rL LLVM

https://reviews.llvm.org/D44132





More information about the llvm-commits mailing list