Skip to content

Add the inreg attribute to sreg when present. #76159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

hjyamauchi
Copy link
Contributor

On Windows/AArch64, a different register is used between when an arugment is both inreg and sret (X0 or X1) and when it is just sret (X8) as the following comment indicates:

https://github.com/llvm/llvm-project/blob/46fe36a4295f05d5d3731762e31fc4e6e99863e9/llvm/lib/Target/AArch64/AArch64CallingConvention.td#L42

  // In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
  // However, on windows, in some circumstances, the SRet is passed in X0 or X1
  // instead.  The presence of the inreg attribute indicates that SRet is
  // passed in the alternative register (X0 or X1), not X8:
  // - X0 for non-instance methods.
  // - X1 for instance methods.

  // The "sret" attribute identifies indirect returns.
  // The "inreg" attribute identifies non-aggregate types.
  // The position of the "sret" attribute identifies instance/non-instance
  // methods.
  // "sret" on argument 0 means non-instance methods.
  // "sret" on argument 1 means instance methods.

  CCIfInReg<CCIfType<[i64],
      CCIfSRet<CCIfType<[i64], CCAssignToReg<[X0, X1]>>>>>,

  CCIfSRet<CCIfType<[i64], CCAssignToReg<[X8]>>>,

So missing/dropping inreg can cause a codegen bug.

This is a partial fix for #74866

@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with this attribute, but the change looks reasonable, thanks!

llvm::AttrBuilder builder(func->getContext());
builder.addAttribute(llvm::Attribute::InReg);
attrs = attrs.addParamAttributes(func->getContext(), argIndex, builder);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I see that this is the established pattern we're using here, but it's clearly wrong and won't handle indirect calls correctly; we need to be setting these attributes based on the CGFunctionInfo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjmccall It's not obvious to me, can you elaborate on how to set these attributes based on the CGFunctionInfo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want the attribute to already be present in the attributes returned by fn.getAttributes(), which ultimately means it should be added in SignatureExpansion::expandExternalSignatureTypes based on the same logic that Clang uses to do it.

On Windows/AArch64, a different register is used between when an
arugment is both inreg and sret (X0 or X1) and when it is just sret
(X8) as the following comment indicates:

https://github.com/llvm/llvm-project/blob/46fe36a4295f05d5d3731762e31fc4e6e99863e9/llvm/lib/Target/AArch64/AArch64CallingConvention.td#L42

```
  // In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
  // However, on windows, in some circumstances, the SRet is passed in X0 or X1
  // instead.  The presence of the inreg attribute indicates that SRet is
  // passed in the alternative register (X0 or X1), not X8:
  // - X0 for non-instance methods.
  // - X1 for instance methods.

  // The "sret" attribute identifies indirect returns.
  // The "inreg" attribute identifies non-aggregate types.
  // The position of the "sret" attribute identifies instance/non-instance
  // methods.
  // "sret" on argument 0 means non-instance methods.
  // "sret" on argument 1 means instance methods.

  CCIfInReg<CCIfType<[i64],
        CCIfSRet<CCIfType<[i64], CCAssignToReg<[X0, X1]>>>>>,

  CCIfSRet<CCIfType<[i64], CCAssignToReg<[X8]>>>,
```

So missing/dropping inreg can cause a codegen bug.

This is a partial fix for swiftlang#74866
@hjyamauchi hjyamauchi changed the title Replicate the inreg attribute from the declaration to the call site Add the inreg attribute to sreg when present. Sep 5, 2024
@hjyamauchi
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, that looks right.

@compnerd
Copy link
Member

compnerd commented Sep 5, 2024

@swift-ci please test Windows platform

1 similar comment
@hjyamauchi
Copy link
Contributor Author

@swift-ci please test Windows platform

@hjyamauchi hjyamauchi merged commit 273f5fd into swiftlang:main Sep 5, 2024
5 checks passed
hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Sep 7, 2024
@egorzhdan
Copy link
Contributor

egorzhdan commented Sep 10, 2024

@hjyamauchi looks like a test started failing on rebranch:

******************** TEST 'Swift(windows-x86_64) :: Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-msvc.swift' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
't:\\5\\bin\\swift-frontend.exe' -target x86_64-unknown-windows-msvc  -module-cache-path T:\5\swift-test-results\x86_64-unknown-windows-msvc\clang-module-cache -vfsoverlay T:/5/tools/swift\stdlib\windows-vfs-overlay.yaml -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules -swift-version 4  -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -typo-correction-limit 10  -emit-irgen -I C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method/Inputs -enable-experimental-cxx-interop C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method\methods-this-and-indirect-return-irgen-msvc.swift | "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\utils\PathSanitizingFileCheck --allow-unused-prefixes --sanitize BUILD_DIR=T:/5/tools/swift --sanitize SOURCE_DIR=C:/Users/swift-ci/jenkins/workspace/swift-rebranch-windows-toolchain/swift --use-filecheck t:\5\bin\filecheck.exe  --enable-windows-compatibility C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method\methods-this-and-indirect-return-irgen-msvc.swift -check-prefix=CHECK -check-prefix=CHECK-x86_64
# executed command: 't:\\5\\bin\\swift-frontend.exe' -target x86_64-unknown-windows-msvc -module-cache-path 'T:\5\swift-test-results\x86_64-unknown-windows-msvc\clang-module-cache' -vfsoverlay 'T:/5/tools/swift\stdlib\windows-vfs-overlay.yaml' -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules -swift-version 4 -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -typo-correction-limit 10 -emit-irgen -I 'C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method/Inputs' -enable-experimental-cxx-interop 'C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method\methods-this-and-indirect-return-irgen-msvc.swift'
# .---command stderr------------
# | <unknown>:0: warning: the '-enable-experimental-cxx-interop' flag is deprecated; please pass '-cxx-interoperability-mode=' instead
# | <unknown>:0: note: Swift will maintain source compatibility for imported APIs based on the selected compatibility mode, so updating the Swift compiler will not change how APIs are imported
# `-----------------------------
# executed command: 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe' 'C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\utils\PathSanitizingFileCheck' --allow-unused-prefixes --sanitize BUILD_DIR=T:/5/tools/swift --sanitize SOURCE_DIR=C:/Users/swift-ci/jenkins/workspace/swift-rebranch-windows-toolchain/swift --use-filecheck 't:\5\bin\filecheck.exe' --enable-windows-compatibility 'C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method\methods-this-and-indirect-return-irgen-msvc.swift' -check-prefix=CHECK -check-prefix=CHECK-x86_64
# .---command stderr------------
# | C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method\methods-this-and-indirect-return-irgen-msvc.swift:18:18: error: CHECK-x86_64: expected string not found in input
# | // CHECK-x86_64: define {{.*}} void @"?nonConstPassThroughAsWrapper@HasMethods@@QEAA?AUNonTrivialInWrapper@@H@Z"(ptr {{.*}} %{{.*}}, ptr noalias sret(%struct.NonTrivialInWrapper) {{.*}} %{{.*}}, i32 noundef %{{.*}})
# |                  ^
# | <stdin>:39:165: note: scanning from here
# |  call void @"?nonConstPassThroughAsWrapper@HasMethods@@QEAA?AUNonTrivialInWrapper@@H@Z"(ptr %instance, ptr noalias sret(%TSo19NonTrivialInWrapperV) %result, i32 42)
# |                                                                                                                                                                     ^
# | 
# | Input file: <stdin>
# | Check file: C:\Users\swift-ci\jenkins\workspace\swift-rebranch-windows-toolchain\swift\test\Interop\Cxx\class\method\methods-this-and-indirect-return-irgen-msvc.swift
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           .
# |           .
# |           .
# |          34:  %result = alloca %TSo19NonTrivialInWrapperV, align 4 
# |          35:  call void @llvm.memset.p0.i64(ptr align 4 %result, i8 0, i64 4, i1 false) 
# |          36:  call void @llvm.lifetime.start.p0(i64 1, ptr %instance) 
# |          37:  %0 = call ptr @"__swift_cxx_ctor??0HasMethods@@QEAA@XZ"(ptr %instance) 
# |          38:  call void @llvm.lifetime.start.p0(i64 4, ptr %result) 
# |          39:  call void @"?nonConstPassThroughAsWrapper@HasMethods@@QEAA?AUNonTrivialInWrapper@@H@Z"(ptr %instance, ptr noalias sret(%TSo19NonTrivialInWrapperV) %result, i32 42) 
# | check:18                                                                                                                                                                         X error: no match found
# |          40:  %result.value = getelementptr inbounds %TSo19NonTrivialInWrapperV, ptr %result, i32 0, i32 0 
# | check:18     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          41:  %result.value._value = getelementptr inbounds %Ts5Int32V, ptr %result.value, i32 0, i32 0 
# | check:18     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          42:  %1 = load i32, ptr %result.value._value, align 4 
# | check:18     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          43:  call void @"??1NonTrivialInWrapper@@QEAA@XZ"(ptr %result) 
# | check:18     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          44:  call void @llvm.lifetime.end.p0(i64 4, ptr %result) 
# | check:18     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           .
# |           .
# |           .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

https://ci-external.swift.org/job/swift-rebranch-windows-toolchain/311/console

It seems to be failing on x86_64, do you know if inreg should also be added to the expected test output there?

@hjyamauchi
Copy link
Contributor Author

@egorzhdan inreg shouldn't be there for x86_64 but I suppose the param attributes could change on a rebranch. How do I locally reproduce this (which branches do the swift and llvm-project repo need to be sync'd to)? CC @compnerd

@hjyamauchi
Copy link
Contributor Author

The CI link isn't the correct one?
I see

  Swift(windows-x86_64) :: Interop/Cxx/stdlib/use-std-vector.swift

@egorzhdan
Copy link
Contributor

@hjyamauchi
Copy link
Contributor Author

CC @rjmccall @compnerd @hyp This PR missed an additional missing inreg on sret and #76324 should fix it. Please take a look.

@hjyamauchi
Copy link
Contributor Author

@egorzhdan I will take a look at the test failure.

@hjyamauchi
Copy link
Contributor Author

@egorzhdan This PR #76373 should already fix the failure CC @hyp

@egorzhdan
Copy link
Contributor

That's right, thanks @hjyamauchi.

hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Sep 24, 2024
hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Oct 28, 2024
On Windows/AArch64, a different register is used between when an
arugment is both inreg and sret (X0 or X1) and when it is just sret
(X8) as the following comment indicates:

https://github.com/llvm/llvm-project/blob/46fe36a4295f05d5d3731762e31fc4e6e99863e9/llvm/lib/Target/AArch64/AArch64CallingConvention.td#L42

```
// In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
// However, on windows, in some circumstances, the SRet is passed in X0 or X1
// instead.  The presence of the inreg attribute indicates that SRet is
// passed in the alternative register (X0 or X1), not X8:
// - X0 for non-instance methods.
// - X1 for instance methods.

// The "sret" attribute identifies indirect returns.
// The "inreg" attribute identifies non-aggregate types.
// The position of the "sret" attribute identifies instance/non-instance
// methods.
// "sret" on argument 0 means non-instance methods.
// "sret" on argument 1 means instance methods.

  CCIfInReg<CCIfType<[i64],
          CCIfSRet<CCIfType<[i64], CCAssignToReg<[X0, X1]>>>>>,

  CCIfSRet<CCIfType<[i64], CCAssignToReg<[X8]>>>,
```

So missing/dropping inreg can cause a codegen bug.

This is a partial fix for swiftlang#74866

Cherrypick swiftlang#76159
hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Oct 29, 2024
On Windows/AArch64, a different register is used between when an
arugment is both inreg and sret (X0 or X1) and when it is just sret
(X8) as the following comment indicates:

https://github.com/llvm/llvm-project/blob/46fe36a4295f05d5d3731762e31fc4e6e99863e9/llvm/lib/Target/AArch64/AArch64CallingConvention.td#L42

```
// In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
// However, on windows, in some circumstances, the SRet is passed in X0 or X1
// instead.  The presence of the inreg attribute indicates that SRet is
// passed in the alternative register (X0 or X1), not X8:
// - X0 for non-instance methods.
// - X1 for instance methods.

// The "sret" attribute identifies indirect returns.
// The "inreg" attribute identifies non-aggregate types.
// The position of the "sret" attribute identifies instance/non-instance
// methods.
// "sret" on argument 0 means non-instance methods.
// "sret" on argument 1 means instance methods.

  CCIfInReg<CCIfType<[i64],
          CCIfSRet<CCIfType<[i64], CCAssignToReg<[X0, X1]>>>>>,

  CCIfSRet<CCIfType<[i64], CCAssignToReg<[X8]>>>,
```

So missing/dropping inreg can cause a codegen bug.

This is a partial fix for swiftlang#74866

Cherrypick swiftlang#76159
hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Nov 1, 2024
On Windows/AArch64, a different register is used between when an
arugment is both inreg and sret (X0 or X1) and when it is just sret
(X8) as the following comment indicates:

https://github.com/llvm/llvm-project/blob/46fe36a4295f05d5d3731762e31fc4e6e99863e9/llvm/lib/Target/AArch64/AArch64CallingConvention.td#L42

```
// In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
// However, on windows, in some circumstances, the SRet is passed in X0 or X1
// instead.  The presence of the inreg attribute indicates that SRet is
// passed in the alternative register (X0 or X1), not X8:
// - X0 for non-instance methods.
// - X1 for instance methods.

// The "sret" attribute identifies indirect returns.
// The "inreg" attribute identifies non-aggregate types.
// The position of the "sret" attribute identifies instance/non-instance
// methods.
// "sret" on argument 0 means non-instance methods.
// "sret" on argument 1 means instance methods.

  CCIfInReg<CCIfType<[i64],
            CCIfSRet<CCIfType<[i64], CCAssignToReg<[X0, X1]>>>>>,

  CCIfSRet<CCIfType<[i64], CCAssignToReg<[X8]>>>,
```

So missing/dropping inreg can cause a codegen bug.

This is a partial fix for swiftlang#74866

Cherrypick swiftlang#76159
hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Nov 13, 2024
On Windows/AArch64, a different register is used between when an
arugment is both inreg and sret (X0 or X1) and when it is just sret
(X8) as the following comment indicates:

https://github.com/llvm/llvm-project/blob/46fe36a4295f05d5d3731762e31fc4e6e99863e9/llvm/lib/Target/AArch64/AArch64CallingConvention.td#L42

```
  // In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
  // However, on windows, in some circumstances, the SRet is passed in X0 or X1
  // instead.  The presence of the inreg attribute indicates that SRet is
  // passed in the alternative register (X0 or X1), not X8:
  // - X0 for non-instance methods.
  // - X1 for instance methods.

  // The "sret" attribute identifies indirect returns.
  // The "inreg" attribute identifies non-aggregate types.
  // The position of the "sret" attribute identifies instance/non-instance
  // methods.
  // "sret" on argument 0 means non-instance methods.
  // "sret" on argument 1 means instance methods.

  CCIfInReg<CCIfType<[i64],
        CCIfSRet<CCIfType<[i64], CCAssignToReg<[X0, X1]>>>>>,

  CCIfSRet<CCIfType<[i64], CCAssignToReg<[X8]>>>,
```

So missing/dropping inreg can cause a codegen bug.

This is a partial fix for swiftlang#74866

Cherrypick commit 3f0de57
Cherrypick PR swiftlang#76159
hjyamauchi added a commit to hjyamauchi/swift that referenced this pull request Nov 15, 2024
On Windows/AArch64, a different register is used between when an
arugment is both inreg and sret (X0 or X1) and when it is just sret
(X8) as the following comment indicates:

https://github.com/llvm/llvm-project/blob/46fe36a4295f05d5d3731762e31fc4e6e99863e9/llvm/lib/Target/AArch64/AArch64CallingConvention.td#L42

```
  // In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
  // However, on windows, in some circumstances, the SRet is passed in X0 or X1
  // instead.  The presence of the inreg attribute indicates that SRet is
  // passed in the alternative register (X0 or X1), not X8:
  // - X0 for non-instance methods.
  // - X1 for instance methods.

  // The "sret" attribute identifies indirect returns.
  // The "inreg" attribute identifies non-aggregate types.
  // The position of the "sret" attribute identifies instance/non-instance
  // methods.
  // "sret" on argument 0 means non-instance methods.
  // "sret" on argument 1 means instance methods.

  CCIfInReg<CCIfType<[i64],
        CCIfSRet<CCIfType<[i64], CCAssignToReg<[X0, X1]>>>>>,

  CCIfSRet<CCIfType<[i64], CCAssignToReg<[X8]>>>,
```

So missing/dropping inreg can cause a codegen bug.

This is a partial fix for swiftlang#74866

Cherrypick commit 3f0de57
Cherrypick PR swiftlang#76159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants