[PATCH] D87293: [GVN] Fix undef incoming value for phi node when new loop exit block created.

weiwei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 03:00:18 PDT 2020


wwei added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:2748
 
       if (llvm::any_of(successors(P),
                        [B](BasicBlock *Succ) { return Succ == B; }) &&
----------------
asbirlea wrote:
> It doesn't look like this condition is needed here anymore, since splitting critical edges is done below. So just checking isCriticalEdge should be enough to make it a candidate.
> 
> Simplify this to iterate over B's predecessors directly; the vector is not needed when predecessors don't change.
Thanks,  fixed.


================
Comment at: llvm/test/Transforms/GVN/pr47462.ll:1
+; RUN: opt -S -gvn -enable-load-pre < %s | FileCheck %s
+
----------------
asbirlea wrote:
> Can you add a RUN line using the new pass manager? (`-passes=...`)
done


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

https://reviews.llvm.org/D87293



More information about the llvm-commits mailing list