diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-01 16:41:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-01 16:41:04 +0100 |
| commit | a56e85a827140ff70e650de2658db0800e06d6f8 (patch) | |
| tree | b6137dc4626b84d7f7c22ef022dfd80d8890bc87 /compiler/rustc_codegen_llvm/src | |
| parent | 9dfdef618ca856c71e69e49b30e6bfc354760131 (diff) | |
| parent | c5835cd648da820fa4875376bb3fb15bb4511e0b (diff) | |
| download | rust-a56e85a827140ff70e650de2658db0800e06d6f8.tar.gz rust-a56e85a827140ff70e650de2658db0800e06d6f8.zip | |
Rollup merge of #136307 - WaffleLapkin:minminmin, r=scottmcm
Implement all mix/max functions in a (hopefully) more optimization amendable way
Previously the graph was like this:
```
min -> Ord::min -> min_by -> match on compare() (in these cases compare = Ord::cmp)
^
|
min_by_key
```
now it looks like this:
```
min -> Ord::min -> `<=` <- min_by_key
min_by -> `Ordering::is_le` of `compare()`
```
(`max*` and `minmax*` are the exact same, i.e. they also use `<=` and `is_le`)
I'm not sure how to test this, but it should probably be easier for the backend to optimize.
r? `@scottmcm`
cc https://github.com/rust-lang/rust/issues/115939#issuecomment-2622161134
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
