HomePhabricator

[InstCombine] Simplify calls with "returned" attribute

Authored by nikic on Mar 7 2020, 3:34 PM.

Description

[InstCombine] Simplify calls with "returned" attribute

If a call argument has the "returned" attribute, we can simplify
the call to the value of that argument. This was already partially
handled by InstSimplify/InstCombine for the case where the argument
is an integer constant, and the result is thus known via known bits.
The non-constant (or non-int) argument cases weren't handled though.

This previously landed as an InstSimplify transform, but was reverted
due to assertion failures when compiling the Linux kernel. The reason
is that simplifying a call to another call breaks assumptions in
call graph updating during inlining. As the code is not easy to fix,
and there is no particularly strong motivation for having this in
InstSimplify, the transform is only performed in InstCombine instead.

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

Details

Committed
nikicMar 20 2020, 9:23 AM
Differential Revision
D75815: [InstCombine] Simplify calls with "returned" attribute
Parents
rG9cf920e64d18: [ARM] Extra MVE float loop tests. NFC
Branches
Unknown
Tags
Unknown