[PATCH] D106995: [IROutliner] Allowing PHINodes in Exit Blocks

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 14:45:41 PDT 2021


paquette added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/IROutliner.cpp:110
+  /// -2 and -1 are assigned by the DenseMap.
+  unsigned PHINodeGVNTracker = -3;
+
----------------
AndrewLitteken wrote:
> paquette wrote:
> > Can we assert somewhere that -2 and -1 are actually used by DenseMap?
> I'm not sure where to do that? They are representing the tombstone value, and empty key value, so you can't use them as keys for other items.
The MachineOutliner does:

```
  InstructionMapper() {
    // Make sure that the implementation of DenseMapInfo<unsigned> hasn't
    // changed.
    assert(DenseMapInfo<unsigned>::getEmptyKey() == (unsigned)-1 &&
           "DenseMapInfo<unsigned>'s empty key isn't -1!");
    assert(DenseMapInfo<unsigned>::getTombstoneKey() == (unsigned)-2 &&
           "DenseMapInfo<unsigned>'s tombstone key isn't -2!");
  }
```


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

https://reviews.llvm.org/D106995



More information about the llvm-commits mailing list