Re: [PATCH] libstdc++: Add unreachable checks to begin/end [PR111499]

2025-04-04 Thread Andrew Pinski
On Fri, Apr 4, 2025 at 3:37 PM Andrew Pinski wrote: > > To help along cases where begin and end are passed on to another function > and then uses std::distance on them. In the case of the testcases added, > std::lexicographical_compare_three_way (for C++20). We now able to opimize > `vector < know

[PATCH] libstdc++: Add unreachable checks to begin/end [PR111499]

2025-04-04 Thread Andrew Pinski
To help along cases where begin and end are passed on to another function and then uses std::distance on them. In the case of the testcases added, std::lexicographical_compare_three_way (for C++20). We now able to opimize `vector < known empty vector` to a constant where before we would need to loa

[PATCH] libstdc++: Add unreachable checks to begin/end [PR111499]

2025-04-04 Thread Andrew Pinski
To help along cases where begin and end are passed on to another function and then uses std::distance on them. In the case of the testcases added, std::lexicographical_compare_three_way (for C++20). We now able to opimize `vector < known empty vector` to a constant where before we would need to loa