rustc_codegen_llvm: Tidying of update_target_reliable_float_cfg by a4lg · Pull Request #146747 · rust-lang/rust (original) (raw)
This PR simplifies floating type handling through update_target_reliable_float_cfg based on several facts:
- Major changes in behavior normally occurs only on the major LLVM upgrade.
- 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)