[NewGVN] Make sure we do not add a user to itself.

If we simplify an instruction to itself, we do not need to add a user to
itself. For congruence classes with a defining expression, we already
use a similar logic.

Fixes PR38259.

Reviewers: davide, efriedma, mcrosier

Reviewed By: davide

Differential Revision: https://reviews.llvm.org/D51168


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346335 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed