[InstSimplify] Clarify SimplifyWithOpReplaced() return value
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 16 Sep 2020 18:49:08 +0000 (20:49 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 16 Sep 2020 18:53:26 +0000 (20:53 +0200)
commit0bb06f297fe52a5125952cb6f1e264b4e7c48097
treeab3c61e545c6b47eecc865d5cec6cfef58738edf
parent94d912021ff35d33cde96dacd6f1db925fe9f2b8
[InstSimplify] Clarify SimplifyWithOpReplaced() return value

If SimplifyWithOpReplaced() cannot simplify the value, null should
be returned. Make sure this really does happen in all cases,
including those where SimplifyBinOp() returns the original value.

This does not matter for existing users, but does mattter for
D87480, which would go into an infinite loop otherwise.
llvm/include/llvm/Analysis/InstructionSimplify.h
llvm/lib/Analysis/InstructionSimplify.cpp