[PATCH] D28594: NewGVN: Move leaders around properly to ensure we have a canonical dominating leader. Fixes PR 31613.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 21:24:46 PST 2017


dberlin added a comment.

Also, this was 3-staged on darwin and linux



================
Comment at: lib/Transforms/Scalar/NewGVN.cpp:331
   Value *lookupOperandLeader(Value *, const User *, const T &) const;
-  void performCongruenceFinding(Value *, const Expression *);
-  void moveValueToNewCongruenceClass(Value *, CongruenceClass *,
+  void performCongruenceFinding(Instruction *, const Expression *);
+  void moveValueToNewCongruenceClass(Instruction *, CongruenceClass *,
----------------
These are only ever called with instructions, and doing this saves us a ton of work in the new work on moveValueToNewCongruenceClass.

I can split out the change if we want.



================
Comment at: lib/Transforms/Scalar/NewGVN.cpp:1079
+  // instruction.  We simply check that the member instruction does not properly
+  // dominate the new class leader.
+  assert(
----------------
(IE  the reverse check)


https://reviews.llvm.org/D28594





More information about the llvm-commits mailing list