[PATCH] D46426: [SROA] Handle PHI with multiple duplicate predecessors

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 13:18:36 PDT 2018


bjope added inline comments.


================
Comment at: lib/Transforms/Scalar/SROA.cpp:1273
+        HI = Handled.find(Pred);
+    if (HI != Handled.end()) {
+      assert(HI->second.first == InVal &&
----------------
efriedma wrote:
> DenseMap has a method "lookup" you can use to avoid the iterator.
So if I have a
```
DenseMap<BasicBlock*, Value*> Map;
```
can I do

```
Value* V = Map.lookup(Pred);
```
and expect to get a null pointer in case Pred isn't found?



Repository:
  rL LLVM

https://reviews.llvm.org/D46426





More information about the llvm-commits mailing list