[PATCH] D60619: New pass to produce more easily-read IR.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 11:56:31 PDT 2019


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/ImproveReadingOrder.cpp:96
+             Terminator->getNumSuccessors() + 1);
+      std::map<std::pair<uint, uint>, BasicBlock *> Ordered;
+      uint n = 0;
----------------
jdoerfert wrote:
> `uint` -> `uint64_t` (to match `getZExtValue`)
> Also, why do you do sorting through a `std::map`? Is there a guarantee that it will be sorted (in the way you need it)?
> I'd put all in a `SmallVector<std::pair<uint64_t, uint64_t>, 8> Ordered.`, then
> call `llvm::sort(Ordered);`
Or use MapVector, if it accepts std::pair as KeyT https://www.llvm.org/docs/ProgrammersManual.html#llvm-adt-mapvector-h


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60619/new/

https://reviews.llvm.org/D60619





More information about the llvm-commits mailing list