| author | bors <bors@rust-lang.org> 2026-03-28 10:44:18 UTC |
| committer | bors <bors@rust-lang.org> 2026-03-28 10:44:18 UTC |
| log | 7e28c7438a7b0c79a09724ba799d32ed461beb72 |
| tree | bac93e10da89d000a8a47c40b33ac08a11924403 |
| parent | 79531c53ded6316bd4973f60bc992954255b8b10 |
| parent | 6e2522e6e23fb5195d1413e79d077b66a5c1a3a2 |
constify `Step` trait and all of its `impl`ementations
constifying [Step](https://github.com/rust-lang/rust/issues/42168) trait and all of its implementations, with some friendly help from [const_cmp](https://github.com/rust-lang/rust/issues/143800)5 files changed, 94 insertions(+), 47 deletions(-)
library/core/src/array/mod.rs+4-2| ... | ... | @@ -405,7 +405,8 @@ where |
| 405 | 405 | |
| 406 | 406 | /// Implements comparison of arrays [lexicographically](Ord#lexicographical-comparison). |
| 407 | 407 | #[stable(feature = "rust1", since = "1.0.0")] |
| 408 | impl<T: PartialOrd, const N: usize> PartialOrd for [T; N] { | |
| 408 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 409 | impl<T: [const] PartialOrd, const N: usize> const PartialOrd for [T; N] { | |
| 409 | 410 | #[inline] |
| 410 | 411 | fn partial_cmp(&self, other: &[T; N]) -> Option<Ordering> { |
| 411 | 412 | PartialOrd::partial_cmp(&&self[..], &&other[..]) |
| ... | ... | @@ -430,7 +431,8 @@ impl<T: PartialOrd, const N: usize> PartialOrd for [T; N] { |
| 430 | 431 | |
| 431 | 432 | /// Implements comparison of arrays [lexicographically](Ord#lexicographical-comparison). |
| 432 | 433 | #[stable(feature = "rust1", since = "1.0.0")] |
| 433 | impl<T: Ord, const N: usize> Ord for [T; N] { | |
| 434 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 435 | impl<T: [const] Ord, const N: usize> const Ord for [T; N] { | |
| 434 | 436 | #[inline] |
| 435 | 437 | fn cmp(&self, other: &[T; N]) -> Ordering { |
| 436 | 438 | Ord::cmp(&&self[..], &&other[..]) |
library/core/src/iter/range.rs+18-9| ... | ... | @@ -29,7 +29,8 @@ unsafe_impl_trusted_step![AsciiChar char i8 i16 i32 i64 i128 isize u8 u16 u32 u6 |
| 29 | 29 | unstable `Step` trait" |
| 30 | 30 | )] |
| 31 | 31 | #[unstable(feature = "step_trait", issue = "42168")] |
| 32 | pub trait Step: Clone + PartialOrd + Sized { | |
| 32 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 33 | pub const trait Step: [const] Clone + [const] PartialOrd + Sized { | |
| 33 | 34 | /// Returns the bounds on the number of *successor* steps required to get from `start` to `end` |
| 34 | 35 | /// like [`Iterator::size_hint()`][Iterator::size_hint()]. |
| 35 | 36 | /// |
| ... | ... | @@ -262,7 +263,8 @@ macro_rules! step_integer_impls { |
| 262 | 263 | $( |
| 263 | 264 | #[allow(unreachable_patterns)] |
| 264 | 265 | #[unstable(feature = "step_trait", issue = "42168")] |
| 265 | impl Step for $u_narrower { | |
| 266 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 267 | impl const Step for $u_narrower { | |
| 266 | 268 | step_identical_methods!(); |
| 267 | 269 | step_unsigned_methods!(); |
| 268 | 270 | |
| ... | ... | @@ -296,7 +298,8 @@ macro_rules! step_integer_impls { |
| 296 | 298 | |
| 297 | 299 | #[allow(unreachable_patterns)] |
| 298 | 300 | #[unstable(feature = "step_trait", issue = "42168")] |
| 299 | impl Step for $i_narrower { | |
| 301 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 302 | impl const Step for $i_narrower { | |
| 300 | 303 | step_identical_methods!(); |
| 301 | 304 | step_signed_methods!($u_narrower); |
| 302 | 305 | |
| ... | ... | @@ -362,7 +365,8 @@ macro_rules! step_integer_impls { |
| 362 | 365 | $( |
| 363 | 366 | #[allow(unreachable_patterns)] |
| 364 | 367 | #[unstable(feature = "step_trait", issue = "42168")] |
| 365 | impl Step for $u_wider { | |
| 368 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 369 | impl const Step for $u_wider { | |
| 366 | 370 | step_identical_methods!(); |
| 367 | 371 | step_unsigned_methods!(); |
| 368 | 372 | |
| ... | ... | @@ -392,7 +396,8 @@ macro_rules! step_integer_impls { |
| 392 | 396 | |
| 393 | 397 | #[allow(unreachable_patterns)] |
| 394 | 398 | #[unstable(feature = "step_trait", issue = "42168")] |
| 395 | impl Step for $i_wider { | |
| 399 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 400 | impl const Step for $i_wider { | |
| 396 | 401 | step_identical_methods!(); |
| 397 | 402 | step_signed_methods!($u_wider); |
| 398 | 403 | |
| ... | ... | @@ -449,7 +454,8 @@ step_integer_impls! { |
| 449 | 454 | } |
| 450 | 455 | |
| 451 | 456 | #[unstable(feature = "step_trait", issue = "42168")] |
| 452 | impl Step for char { | |
| 457 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 458 | impl const Step for char { | |
| 453 | 459 | #[inline] |
| 454 | 460 | fn steps_between(&start: &char, &end: &char) -> (usize, Option<usize>) { |
| 455 | 461 | let start = start as u32; |
| ... | ... | @@ -536,7 +542,8 @@ impl Step for char { |
| 536 | 542 | } |
| 537 | 543 | |
| 538 | 544 | #[unstable(feature = "step_trait", issue = "42168")] |
| 539 | impl Step for AsciiChar { | |
| 545 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 546 | impl const Step for AsciiChar { | |
| 540 | 547 | #[inline] |
| 541 | 548 | fn steps_between(&start: &AsciiChar, &end: &AsciiChar) -> (usize, Option<usize>) { |
| 542 | 549 | Step::steps_between(&start.to_u8(), &end.to_u8()) |
| ... | ... | @@ -578,7 +585,8 @@ impl Step for AsciiChar { |
| 578 | 585 | } |
| 579 | 586 | |
| 580 | 587 | #[unstable(feature = "step_trait", issue = "42168")] |
| 581 | impl Step for Ipv4Addr { | |
| 588 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 589 | impl const Step for Ipv4Addr { | |
| 582 | 590 | #[inline] |
| 583 | 591 | fn steps_between(&start: &Ipv4Addr, &end: &Ipv4Addr) -> (usize, Option<usize>) { |
| 584 | 592 | u32::steps_between(&start.to_bits(), &end.to_bits()) |
| ... | ... | @@ -610,7 +618,8 @@ impl Step for Ipv4Addr { |
| 610 | 618 | } |
| 611 | 619 | |
| 612 | 620 | #[unstable(feature = "step_trait", issue = "42168")] |
| 613 | impl Step for Ipv6Addr { | |
| 621 | #[rustc_const_unstable(feature = "step_trait", issue = "42168")] | |
| 622 | impl const Step for Ipv6Addr { | |
| 614 | 623 | #[inline] |
| 615 | 624 | fn steps_between(&start: &Ipv6Addr, &end: &Ipv6Addr) -> (usize, Option<usize>) { |
| 616 | 625 | u128::steps_between(&start.to_bits(), &end.to_bits()) |
library/core/src/net/ip_addr.rs+12-6| ... | ... | @@ -68,7 +68,8 @@ pub enum IpAddr { |
| 68 | 68 | /// assert!("0xcb.0x0.0x71.0x00".parse::<Ipv4Addr>().is_err()); // all octets are in hex |
| 69 | 69 | /// ``` |
| 70 | 70 | #[rustc_diagnostic_item = "Ipv4Addr"] |
| 71 | #[derive(Copy, Clone, PartialEq, Eq)] | |
| 71 | #[derive(Copy)] | |
| 72 | #[derive_const(Clone, PartialEq, Eq)] | |
| 72 | 73 | #[stable(feature = "rust1", since = "1.0.0")] |
| 73 | 74 | pub struct Ipv4Addr { |
| 74 | 75 | octets: [u8; 4], |
| ... | ... | @@ -161,7 +162,8 @@ impl Hash for Ipv4Addr { |
| 161 | 162 | /// assert_eq!(localhost.is_loopback(), true); |
| 162 | 163 | /// ``` |
| 163 | 164 | #[rustc_diagnostic_item = "Ipv6Addr"] |
| 164 | #[derive(Copy, Clone, PartialEq, Eq)] | |
| 165 | #[derive(Copy)] | |
| 166 | #[derive_const(Clone, PartialEq, Eq)] | |
| 165 | 167 | #[stable(feature = "rust1", since = "1.0.0")] |
| 166 | 168 | pub struct Ipv6Addr { |
| 167 | 169 | octets: [u8; 16], |
| ... | ... | @@ -1229,7 +1231,8 @@ impl PartialEq<IpAddr> for Ipv4Addr { |
| 1229 | 1231 | } |
| 1230 | 1232 | |
| 1231 | 1233 | #[stable(feature = "rust1", since = "1.0.0")] |
| 1232 | impl PartialOrd for Ipv4Addr { | |
| 1234 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 1235 | impl const PartialOrd for Ipv4Addr { | |
| 1233 | 1236 | #[inline] |
| 1234 | 1237 | fn partial_cmp(&self, other: &Ipv4Addr) -> Option<Ordering> { |
| 1235 | 1238 | Some(self.cmp(other)) |
| ... | ... | @@ -1259,7 +1262,8 @@ impl PartialOrd<IpAddr> for Ipv4Addr { |
| 1259 | 1262 | } |
| 1260 | 1263 | |
| 1261 | 1264 | #[stable(feature = "rust1", since = "1.0.0")] |
| 1262 | impl Ord for Ipv4Addr { | |
| 1265 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 1266 | impl const Ord for Ipv4Addr { | |
| 1263 | 1267 | #[inline] |
| 1264 | 1268 | fn cmp(&self, other: &Ipv4Addr) -> Ordering { |
| 1265 | 1269 | self.octets.cmp(&other.octets) |
| ... | ... | @@ -2232,7 +2236,8 @@ impl PartialEq<Ipv6Addr> for IpAddr { |
| 2232 | 2236 | } |
| 2233 | 2237 | |
| 2234 | 2238 | #[stable(feature = "rust1", since = "1.0.0")] |
| 2235 | impl PartialOrd for Ipv6Addr { | |
| 2239 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 2240 | impl const PartialOrd for Ipv6Addr { | |
| 2236 | 2241 | #[inline] |
| 2237 | 2242 | fn partial_cmp(&self, other: &Ipv6Addr) -> Option<Ordering> { |
| 2238 | 2243 | Some(self.cmp(other)) |
| ... | ... | @@ -2262,7 +2267,8 @@ impl PartialOrd<IpAddr> for Ipv6Addr { |
| 2262 | 2267 | } |
| 2263 | 2268 | |
| 2264 | 2269 | #[stable(feature = "rust1", since = "1.0.0")] |
| 2265 | impl Ord for Ipv6Addr { | |
| 2270 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 2271 | impl const Ord for Ipv6Addr { | |
| 2266 | 2272 | #[inline] |
| 2267 | 2273 | fn cmp(&self, other: &Ipv6Addr) -> Ordering { |
| 2268 | 2274 | self.segments().cmp(&other.segments()) |
library/core/src/slice/cmp.rs+50-19| ... | ... | @@ -3,7 +3,9 @@ |
| 3 | 3 | use super::{from_raw_parts, memchr}; |
| 4 | 4 | use crate::ascii; |
| 5 | 5 | use crate::cmp::{self, BytewiseEq, Ordering}; |
| 6 | use crate::convert::Infallible; | |
| 6 | 7 | use crate::intrinsics::compare_bytes; |
| 8 | use crate::marker::Destruct; | |
| 7 | 9 | use crate::mem::SizedTypeProperties; |
| 8 | 10 | use crate::num::NonZero; |
| 9 | 11 | use crate::ops::ControlFlow; |
| ... | ... | @@ -33,7 +35,8 @@ impl<T: [const] Eq> const Eq for [T] {} |
| 33 | 35 | |
| 34 | 36 | /// Implements comparison of slices [lexicographically](Ord#lexicographical-comparison). |
| 35 | 37 | #[stable(feature = "rust1", since = "1.0.0")] |
| 36 | impl<T: Ord> Ord for [T] { | |
| 38 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 39 | impl<T: [const] Ord> const Ord for [T] { | |
| 37 | 40 | fn cmp(&self, other: &[T]) -> Ordering { |
| 38 | 41 | SliceOrd::compare(self, other) |
| 39 | 42 | } |
| ... | ... | @@ -52,7 +55,8 @@ const fn as_underlying(x: ControlFlow<bool>) -> u8 { |
| 52 | 55 | |
| 53 | 56 | /// Implements comparison of slices [lexicographically](Ord#lexicographical-comparison). |
| 54 | 57 | #[stable(feature = "rust1", since = "1.0.0")] |
| 55 | impl<T: PartialOrd> PartialOrd for [T] { | |
| 58 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 59 | impl<T: [const] PartialOrd> const PartialOrd for [T] { | |
| 56 | 60 | #[inline] |
| 57 | 61 | fn partial_cmp(&self, other: &[T]) -> Option<Ordering> { |
| 58 | 62 | SlicePartialOrd::partial_compare(self, other) |
| ... | ... | @@ -175,19 +179,31 @@ const trait SliceChain: Sized { |
| 175 | 179 | |
| 176 | 180 | type AlwaysBreak<B> = ControlFlow<B, crate::convert::Infallible>; |
| 177 | 181 | |
| 178 | impl<A: PartialOrd> SlicePartialOrd for A { | |
| 182 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 183 | impl<A: [const] PartialOrd> const SlicePartialOrd for A { | |
| 179 | 184 | default fn partial_compare(left: &[A], right: &[A]) -> Option<Ordering> { |
| 180 | let elem_chain = |a, b| match PartialOrd::partial_cmp(a, b) { | |
| 181 | Some(Ordering::Equal) => ControlFlow::Continue(()), | |
| 182 | non_eq => ControlFlow::Break(non_eq), | |
| 183 | }; | |
| 184 | let len_chain = |a: &_, b: &_| ControlFlow::Break(usize::partial_cmp(a, b)); | |
| 185 | // FIXME(const-hack): revert this to a const closure once possible | |
| 186 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 187 | const fn elem_chain<A: [const] PartialOrd>(a: &A, b: &A) -> ControlFlow<Option<Ordering>> { | |
| 188 | match PartialOrd::partial_cmp(a, b) { | |
| 189 | Some(Ordering::Equal) => ControlFlow::Continue(()), | |
| 190 | non_eq => ControlFlow::Break(non_eq), | |
| 191 | } | |
| 192 | } | |
| 193 | ||
| 194 | // FIXME(const-hack): revert this to a const closure once possible | |
| 195 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 196 | const fn len_chain(a: &usize, b: &usize) -> ControlFlow<Option<Ordering>, Infallible> { | |
| 197 | ControlFlow::Break(usize::partial_cmp(a, b)) | |
| 198 | } | |
| 199 | ||
| 185 | 200 | let AlwaysBreak::Break(b) = chaining_impl(left, right, elem_chain, len_chain); |
| 186 | 201 | b |
| 187 | 202 | } |
| 188 | 203 | } |
| 189 | 204 | |
| 190 | impl<A: PartialOrd> SliceChain for A { | |
| 205 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 206 | impl<A: [const] PartialOrd> const SliceChain for A { | |
| 191 | 207 | default fn chaining_lt(left: &[Self], right: &[Self]) -> ControlFlow<bool> { |
| 192 | 208 | chaining_impl(left, right, PartialOrd::__chaining_lt, usize::__chaining_lt) |
| 193 | 209 | } |
| ... | ... | @@ -202,12 +218,13 @@ impl<A: PartialOrd> SliceChain for A { |
| 202 | 218 | } |
| 203 | 219 | } |
| 204 | 220 | |
| 221 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 205 | 222 | #[inline] |
| 206 | fn chaining_impl<'l, 'r, A: PartialOrd, B, C>( | |
| 223 | const fn chaining_impl<'l, 'r, A: PartialOrd, B, C>( | |
| 207 | 224 | left: &'l [A], |
| 208 | 225 | right: &'r [A], |
| 209 | elem_chain: impl Fn(&'l A, &'r A) -> ControlFlow<B>, | |
| 210 | len_chain: impl for<'a> FnOnce(&'a usize, &'a usize) -> ControlFlow<B, C>, | |
| 226 | elem_chain: impl [const] Fn(&'l A, &'r A) -> ControlFlow<B> + [const] Destruct, | |
| 227 | len_chain: impl for<'a> [const] FnOnce(&'a usize, &'a usize) -> ControlFlow<B, C> + [const] Destruct, | |
| 211 | 228 | ) -> ControlFlow<B, C> { |
| 212 | 229 | let l = cmp::min(left.len(), right.len()); |
| 213 | 230 | |
| ... | ... | @@ -216,8 +233,11 @@ fn chaining_impl<'l, 'r, A: PartialOrd, B, C>( |
| 216 | 233 | let lhs = &left[..l]; |
| 217 | 234 | let rhs = &right[..l]; |
| 218 | 235 | |
| 219 | for i in 0..l { | |
| 236 | // FIXME(const-hack): revert this to `for i in 0..l` once `impl const Iterator for Range<T>` | |
| 237 | let mut i: usize = 0; | |
| 238 | while i < l { | |
| 220 | 239 | elem_chain(&lhs[i], &rhs[i])?; |
| 240 | i += 1; | |
| 221 | 241 | } |
| 222 | 242 | |
| 223 | 243 | len_chain(&left.len(), &right.len()) |
| ... | ... | @@ -270,13 +290,24 @@ const trait SliceOrd: Sized { |
| 270 | 290 | fn compare(left: &[Self], right: &[Self]) -> Ordering; |
| 271 | 291 | } |
| 272 | 292 | |
| 273 | impl<A: Ord> SliceOrd for A { | |
| 293 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 294 | impl<A: [const] Ord> const SliceOrd for A { | |
| 274 | 295 | default fn compare(left: &[Self], right: &[Self]) -> Ordering { |
| 275 | let elem_chain = |a, b| match Ord::cmp(a, b) { | |
| 276 | Ordering::Equal => ControlFlow::Continue(()), | |
| 277 | non_eq => ControlFlow::Break(non_eq), | |
| 278 | }; | |
| 279 | let len_chain = |a: &_, b: &_| ControlFlow::Break(usize::cmp(a, b)); | |
| 296 | // FIXME(const-hack): revert this to a const closure once possible | |
| 297 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 298 | const fn elem_chain<A: [const] Ord>(a: &A, b: &A) -> ControlFlow<Ordering> { | |
| 299 | match Ord::cmp(a, b) { | |
| 300 | Ordering::Equal => ControlFlow::Continue(()), | |
| 301 | non_eq => ControlFlow::Break(non_eq), | |
| 302 | } | |
| 303 | } | |
| 304 | ||
| 305 | // FIXME(const-hack): revert this to a const closure once possible | |
| 306 | #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] | |
| 307 | const fn len_chain(a: &usize, b: &usize) -> ControlFlow<Ordering, Infallible> { | |
| 308 | ControlFlow::Break(usize::cmp(a, b)) | |
| 309 | } | |
| 310 | ||
| 280 | 311 | let AlwaysBreak::Break(b) = chaining_impl(left, right, elem_chain, len_chain); |
| 281 | 312 | b |
| 282 | 313 | } |
tests/codegen-llvm/array-cmp.rs+10-11| ... | ... | @@ -39,16 +39,6 @@ pub fn array_of_tuple_le(a: &[(i16, u16); 2], b: &[(i16, u16); 2]) -> bool { |
| 39 | 39 | // CHECK: %[[EQ00:.+]] = icmp eq i16 %[[A00]], %[[B00]] |
| 40 | 40 | // CHECK-NEXT: br i1 %[[EQ00]], label %[[L01:.+]], label %[[EXIT_S:.+]] |
| 41 | 41 | |
| 42 | // CHECK: [[L01]]: | |
| 43 | // CHECK: %[[PA01:.+]] = getelementptr{{.+}}i8, ptr %a, {{i32|i64}} 2 | |
| 44 | // CHECK: %[[PB01:.+]] = getelementptr{{.+}}i8, ptr %b, {{i32|i64}} 2 | |
| 45 | // CHECK: %[[A01:.+]] = load i16, ptr %[[PA01]] | |
| 46 | // CHECK: %[[B01:.+]] = load i16, ptr %[[PB01]] | |
| 47 | // CHECK-NOT: cmp | |
| 48 | // CHECK: %[[EQ01:.+]] = icmp eq i16 %[[A01]], %[[B01]] | |
| 49 | // CHECK-NEXT: br i1 %[[EQ01]], label %[[L10:.+]], label %[[EXIT_U:.+]] | |
| 50 | ||
| 51 | // CHECK: [[L10]]: | |
| 52 | 42 | // CHECK: %[[PA10:.+]] = getelementptr{{.+}}i8, ptr %a, {{i32|i64}} 4 |
| 53 | 43 | // CHECK: %[[PB10:.+]] = getelementptr{{.+}}i8, ptr %b, {{i32|i64}} 4 |
| 54 | 44 | // CHECK: %[[A10:.+]] = load i16, ptr %[[PA10]] |
| ... | ... | @@ -64,7 +54,16 @@ pub fn array_of_tuple_le(a: &[(i16, u16); 2], b: &[(i16, u16); 2]) -> bool { |
| 64 | 54 | // CHECK: %[[B11:.+]] = load i16, ptr %[[PB11]] |
| 65 | 55 | // CHECK-NOT: cmp |
| 66 | 56 | // CHECK: %[[EQ11:.+]] = icmp eq i16 %[[A11]], %[[B11]] |
| 67 | // CHECK-NEXT: br i1 %[[EQ11]], label %[[DONE:.+]], label %[[EXIT_U]] | |
| 57 | // CHECK-NEXT: br i1 %[[EQ11]], label %[[DONE:.+]], label %[[EXIT_U:.+]] | |
| 58 | ||
| 59 | // CHECK: [[L01]]: | |
| 60 | // CHECK: %[[PA01:.+]] = getelementptr{{.+}}i8, ptr %a, {{i32|i64}} 2 | |
| 61 | // CHECK: %[[PB01:.+]] = getelementptr{{.+}}i8, ptr %b, {{i32|i64}} 2 | |
| 62 | // CHECK: %[[A01:.+]] = load i16, ptr %[[PA01]] | |
| 63 | // CHECK: %[[B01:.+]] = load i16, ptr %[[PB01]] | |
| 64 | // CHECK-NOT: cmp | |
| 65 | // CHECK: %[[EQ01:.+]] = icmp eq i16 %[[A01]], %[[B01]] | |
| 66 | // CHECK-NEXT: br i1 %[[EQ01]], label %{{.+}}, label %[[EXIT_U]] | |
| 68 | 67 | |
| 69 | 68 | // CHECK: [[DONE]]: |
| 70 | 69 | // CHECK: %[[RET:.+]] = phi i1 [ %{{.+}}, %[[EXIT_S]] ], [ %{{.+}}, %[[EXIT_U]] ], [ true, %[[L11]] ] |