[Attributor] Remove restriction on simplifying function pointers
authorNikita Popov <npopov@redhat.com>
Thu, 3 Mar 2022 15:10:09 +0000 (16:10 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 7 Mar 2022 10:54:37 +0000 (11:54 +0100)
commit0636c93d3e43220f6513447cf8158e69cc1953c5
treea557c46e965e19afe1ab89a8850251e52d56c367
parentd231fafa40f4d0eb66b692ad8b020590637921cf
[Attributor] Remove restriction on simplifying function pointers

Dropping this restriction seems to work fine (there are no assertion
failures), so it appears that either the updater got smarter or the
problematic cases are restricted elsewhere.

If doing this still causes issues, then the place to address it
would probably be https://github.com/llvm/llvm-project/blob/8f5bdaf481c3f4e6876a5ae0e4d7c6ed2042e6a6/llvm/lib/Transforms/IPO/Attributor.cpp#L1856-L1859,
which already prevents replacement outside the SCC, so I'm not
quite sure what this check is intended to avoid.

Differential Revision: https://reviews.llvm.org/D120987
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/liveness.ll
llvm/test/Transforms/Attributor/value-simplify.ll