[IPSCCP] Add assertion to surface cases where we zap returns with overdefined users.
authorFlorian Hahn <flo@fhahn.com>
Thu, 25 Jul 2019 09:37:09 +0000 (09:37 +0000)
committerFlorian Hahn <flo@fhahn.com>
Thu, 25 Jul 2019 09:37:09 +0000 (09:37 +0000)
commit5354c83ece00690b4dbfa47925f8f5a8f33f1d9e
treedffba50103676d542ccab53a1d1560d601297112
parent48b16e1005df863cf8b6364a6dc3e3e213d7d415
[IPSCCP] Add assertion to surface cases where we zap returns with overdefined users.

We should only zap returns in functions, where all live users have a
replace-able value (are not overdefined). Unused return values should be
undefined.

This should make it easier to detect bugs like in PR42738.

Alternatively we could bail out of zapping the function returns, but I
think it would be better to address those divergences between function
and call-site values where they are actually caused.

Reviewers: davide, efriedma

Reviewed By: davide, efriedma

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

llvm-svn: 366998
llvm/lib/Transforms/Scalar/SCCP.cpp