[IR] Require intrinsic struct return type to be anonymous
authorNikita Popov <npopov@redhat.com>
Fri, 25 Mar 2022 09:50:13 +0000 (10:50 +0100)
committerNikita Popov <npopov@redhat.com>
Wed, 30 Mar 2022 07:51:24 +0000 (09:51 +0200)
commit8a72391f609f016b0aef17e728aca65027a80cc4
tree27b84859a3c0d8fd89dc6acd3aba41203fe53273
parentf54f448525e3c6ba39c9cea9f166192593c25133
[IR] Require intrinsic struct return type to be anonymous

This is an alternative to D122376. Rather than working around the
problem, this patch requires that struct return types in intrinsics
are anonymous/literal and adds auto-upgrade code to convert
existing uses of intrinsics with named struct types.

This ensures that the mapping between intrinsic name and
intrinsic function type is actually bijective, as it is supposed
to be.

This also fixes https://github.com/llvm/llvm-project/issues/37891.

Differential Revision: https://reviews.llvm.org/D122471
clang/test/CodeGenCUDA/texture.cu
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/IR/Function.cpp
llvm/test/Bitcode/intrinsics-struct-upgrade.ll [new file with mode: 0644]
llvm/test/Bitcode/intrinsics-struct-upgrade.ll.bc [new file with mode: 0644]
llvm/test/CodeGen/X86/2009-04-12-FastIselOverflowCrash.ll
llvm/test/CodeGen/X86/fast-isel-extract.ll