Commit graph

5 commits

Author SHA1 Message Date
Amanieu d'Antras
5d90ccb0fa Move select_unpredictable to the hint module 2025-04-13 01:34:25 +01:00
Jubilee Young
3c0c9b6770 tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
Trevor Gross
74d2d4bfa4 Expand the select_unpredictable test for ZSTs
For ZSTs there is no selection that needs to take place, so assert that
no `select` statement is emitted.
2025-01-05 08:51:15 +00:00
Trevor Gross
d42c3ae02f Merge the intrinsic and user tests for select_unpredictable
[1] mentions that having a single test with `-Zmerge-functions=disabled`
is preferable to having two separate tests.  Apply that to the new
`select_unpredicatble` test here.

[1]: https://github.com/rust-lang/rust/pull/133964#issuecomment-2569693325
2025-01-05 01:17:07 +00:00
Amanieu d'Antras
4f78f9fbb0 Force LLVM to use CMOV for binary search
Since https://reviews.llvm.org/D118118, LLVM will no longer turn CMOVs
into branches if it comes from a `select` marked with an `unpredictable`
metadata attribute.

This PR introduces `core::intrinsics::select_unpredictable` which emits
such a `select` and uses it in the implementation of `binary_search_by`.
2024-07-28 17:24:57 +01:00