[AutoUpgrade] Don't upgrade intrinsics returning overloaded struct type
authorNikita Popov <npopov@redhat.com>
Wed, 30 Mar 2022 15:25:49 +0000 (17:25 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 30 Mar 2022 15:27:26 +0000 (17:27 +0200)
commitd6887256c2cae1b1b721bd47459be6d86003db6f
tree93006292786f1c54dbea23f3b4daabffdb53025d
parentf29002a4b71b7734dfc4bd0e62eec2d341edb3fd
[AutoUpgrade] Don't upgrade intrinsics returning overloaded struct type

We only want to do the upgrade from named to anonymous struct
return if the intrinsic is declared to return a struct, but not
if it has an overloaded return type that just happens to be a
struct. In that case the struct type will be mangled into the
intrinsic name and there is no problem.

This should address the problem reported in
https://reviews.llvm.org/D122471#3416598.
llvm/lib/IR/AutoUpgrade.cpp
llvm/test/Assembler/struct-ret-without-upgrade.ll [new file with mode: 0644]