Skip to content

Conversation

aviatesk
Copy link
Member

Adds a dedicated _svec_len_nothrow function that does more precise :nothrow modeling of Core._svec_len implemented in #59548.

@aviatesk aviatesk added the backport 1.12 Change should be backported to release-1.12 label Sep 30, 2025
Adds a dedicated `_svec_len_nothrow` function that does more precise
`:nothrow` modeling of `Core._svec_len` implemented in
#59548.
@aviatesk aviatesk force-pushed the avi/svec_len_nothrow branch from 980bde6 to c0d41cc Compare September 30, 2025 15:30
@aviatesk aviatesk requested a review from Copilot September 30, 2025 16:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the nothrow modeling for Core._svec_len by introducing a dedicated _svec_len_nothrow function that provides more precise :nothrow analysis. Previously, the nothrow check was based on whether the result was a constant, but now it checks if the argument is a subtype of SimpleVector.

  • Adds _svec_len_nothrow function for precise nothrow modeling
  • Updates _builtin_nothrow to use the new function instead of constant-based checking
  • Adds test to verify length on Core.SimpleVector is now nothrow

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Compiler/src/tfuncs.jl Adds _svec_len_nothrow function and updates nothrow logic for Core._svec_len
Compiler/test/effects.jl Adds test verifying nothrow behavior for length on Core.SimpleVector

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@aviatesk aviatesk added the merge me PR is reviewed. Merge when all tests are passing label Sep 30, 2025
@aviatesk aviatesk merged commit 694902b into master Sep 30, 2025
5 of 8 checks passed
@aviatesk aviatesk deleted the avi/svec_len_nothrow branch September 30, 2025 19:21
@aviatesk aviatesk removed the merge me PR is reviewed. Merge when all tests are passing label Sep 30, 2025
@oscardssmith oscardssmith added the compiler:effects effect analysis label Sep 30, 2025
@oscardssmith
Copy link
Member

why is this on the backport label? It doesn't seem like a bugfix?

@aviatesk
Copy link
Member Author

Since this is simple enough to be backported, while this is necessary for tools like JET relying on the compiler to behave reasonably on 1.12.

@aviatesk aviatesk mentioned this pull request Sep 30, 2025
31 tasks
@aviatesk aviatesk removed the backport 1.12 Change should be backported to release-1.12 label Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:effects effect analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants