[InstCombine] Simplify calls with casted `returned` attribute
authorJohannes Doerfert <johannes@jdoerfert.de>
Sun, 12 Apr 2020 17:41:56 +0000 (12:41 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 16 Apr 2020 05:56:00 +0000 (00:56 -0500)
commitea7f17ee387062fcb74af2ba27c426a68c6bc8ad
tree67835af5156f74e092d13570318baf21e58f73c9
parent8ad19ffa7bd2ce50b90f3214b6012ec2d880cf52
[InstCombine] Simplify calls with casted `returned` attribute

The handling of the `returned` attribute in D75815 did miss the case
where the argument is (bit)casted to a different type. This is
explicitly allowed by the language reference and exposed by the
Attributor.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D77977
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/call-returned.ll