[PATCH] D64866: [PredicateInfo] Replace pointer comparisons with deterministic compares.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 09:52:48 PDT 2019


fhahn marked 3 inline comments as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/PredicateInfo.cpp:151
+    bool isADef = A.Def;
+    bool isAU = A.U;
+    bool isBDef = B.Def;
----------------
efriedma wrote:
> Isn't `isAU` always equal to `!isADef`?
For edge only entries, both are null, but we still only need one.


================
Comment at: llvm/lib/Transforms/Utils/PredicateInfo.cpp:198
+    unsigned AIn = DomADest->getDFSNumIn();
+    unsigned AOut = DomADest->getDFSNumOut();
+    unsigned BIn = DomBDest->getDFSNumIn();
----------------
efriedma wrote:
> Do you really need to compare AOut?  getDFSNumIn() should be unique for every domtree node.
Thanks, I was going with the existing code to start with, but only comparing in numbers should be fine here (and a few other places I also adjusted)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64866





More information about the llvm-commits mailing list