-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ||
; RUN: opt -S < %s | FileCheck %s | ||
|
||
; This is an overloaded struct return, we should not try to update it to an | ||
; anonymous struct return. | ||
|
||
%ty = type { i32 } | ||
|
||
define %ty @test(%ty %arg) { | ||
; CHECK-LABEL: @test( | ||
; CHECK-NEXT: [[COPY:%.*]] = call [[TY:%.*]] @llvm.ssa.copy.s_tys([[TY]] [[ARG:%.*]]) | ||
; CHECK-NEXT: ret [[TY]] [[COPY]] | ||
; | ||
%copy = call %ty @llvm.ssa.copy.s_tys(%ty %arg) | ||
ret %ty %copy | ||
} | ||
|
||
declare %ty @llvm.ssa.copy.s_tys(%ty) |