[PATCH] D32990: [NewGVN] Take in account incoming edges computing congruent PhiExpression(s)

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 21:52:53 PDT 2017


dberlin added inline comments.


================
Comment at: include/llvm/Transforms/Scalar/GVNExpression.h:503
+    for (unsigned I = 0; I != getNumOperands(); ++I) {
+      if (IncomingBBs[I] != OE.IncomingBBs[I])
+        return false;
----------------
dberlin wrote:
> This would actually be wrong.
> They are congruent if the same incoming bbs have the same arguments ,and for a given block, the set of incomingbbs is always the same.
> The only issue here is the order of the incoming bbs.
IE the following phis are congruent

phi i16 [0, %foo], [1, %bar]
phi i16 [1, %bar], [0, %foo]



https://reviews.llvm.org/D32990





More information about the llvm-commits mailing list