[PATCH] D59462: [WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 16 18:23:43 PDT 2019


aheejin marked an inline comment as done.
aheejin added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp:406
+  // <<Predecessor is within the loop?, loop entry>, routing block>
+  std::map<std::pair<bool, MachineBasicBlock *>, MachineBasicBlock *> Map;
+  for (auto *Pred : AllPreds) {
----------------
riccibruno wrote:
> aheejin wrote:
> > This was previously `DenseMap`, but I changed this to `std::map` because to use `std::pair` as a key to `DenseMap` I need to write `DenseMapInfo` routines and I don't think it's really worth it because this map will be quite small anyway.
> Note that `DenseMapInfo` is already implemented for `std::pair`
Thank you. But I think I was not correct by saying `std::pair` is not supported; the real problem looks like we don't have `DenseMapInfo` for `bool`. For example, this does not compile (without extra implementation of `DenseMapInfo` for `bool`)
```
DenseMap<bool, int> Map;
```


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59462





More information about the llvm-commits mailing list