Skip to content

Conversation

a4lg
Copy link
Contributor

@a4lg a4lg commented Sep 19, 2025

This PR simplifies floating type handling through update_target_reliable_float_cfg based on several facts:

  1. Major changes in behavior normally occurs only on the major LLVM upgrade.
  2. The first release of LLVM 20.x.x is 20.1.0.

Due to the first fact, we can normally ignore minor and patch releases of LLVM and we can remove obscure variables like lt_xx_x_x.
The second fact is missed when the minimum LLVM version is raised to LLVM 20 (cf. #145071) and one "fixed in LLVM 20" case can be safely removed (another cannot be removed since it's fixed on LLVM 20.1.1).

It also reorders certain match clauses by the architecture when there's no problems reordering it.

Note that, an LLVM issue on MIPS is fixed on LLVM 20.1.0 and another on AArch64 is fixed on LLVM 20.1.1.
Originally, they are both considered fixed on LLVM 20.1.1 but the author separated them into two cases (so that the MIPS bug checking can be removed).


Related: #146615 (uses similar method to extract LLVM version)
Related: #145071 (follow-up of the minimum LLVM version upgrade to LLVM 20)

r? @workingjubilee

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 19, 2025

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@a4lg
Copy link
Contributor Author

a4lg commented Sep 19, 2025

Sorry, it seems this function has more problems than it looks and re-investigating now.

@a4lg a4lg force-pushed the codegen-llvm-feature-float-tidying branch from d1c55e3 to 924c9bc Compare September 19, 2025 05:05
@rustbot

This comment has been minimized.

@a4lg a4lg force-pushed the codegen-llvm-feature-float-tidying branch from 924c9bc to 5ae61db Compare September 19, 2025 05:06
@a4lg
Copy link
Contributor Author

a4lg commented Sep 19, 2025

Re-investigation complete.
I had to separate version checking of version < 20.1.1 into version < 20.1.0 (a MIPS case; equivalent to version < 20) and version < 20.1.1 (an AArch64 case) then perform the rest of the changes.

... in `update_target_reliable_float_cfg`, based on the actual changes.
The AArch64 issue is fixed on LLVM 20.1.1 while the MIPS issue is fixed
on LLVM 20.1.0 (the first LLVM 20 release).

This commit distinguishes two separate cases.
This commit simplifies floating type handling through
`update_target_reliable_float_cfg` based on several facts:

1.  Major changes in behavior normally occurs only
    on the major LLVM upgrade.
2.  The first release of LLVM 20.x.x is 20.1.0.

Due to the first fact, we can normally ignore minor and patch releases
of LLVM and we can remove obscure variables like `lt_xx_x_x` (still,
there is a case where checking for patch version is required).

The second fact is missed when the minimum LLVM version is raised to
LLVM 20 and one "fixed in LLVM 20" case can be safely removed.
…cfg`

This commit reorders certain match clauses in
`update_target_reliable_float_cfg` by the architecture when
there's no problems reordering it.
@a4lg a4lg force-pushed the codegen-llvm-feature-float-tidying branch from 5ae61db to de33db2 Compare September 19, 2025 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants