We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2874876 commit 107d7efCopy full SHA for 107d7ef
tests/codegen/issues/looping-over-ne-bytes-133528.rs
@@ -0,0 +1,17 @@
1
+//@ compile-flags: -Copt-level=3
2
+//@ min-llvm-version: 20
3
+#![crate_type = "lib"]
4
+
5
+/// Ensure the function is properly optimized
6
+/// In the issue #133528, the function was not getting optimized
7
+/// whereas, a version with `bytes` wrapped into a `black_box` was optimized
8
+/// It was probably a LLVM bug that was fixed in LLVM 20
9
10
+// CHECK-LABEL: @looping_over_ne_bytes
11
+// CHECK: icmp eq i64 %input, -1
12
+// CHECK-NEXT: ret i1
13
+#[no_mangle]
14
+fn looping_over_ne_bytes(input: u64) -> bool {
15
+ let bytes = input.to_ne_bytes();
16
+ bytes.iter().all(|x| *x == !0)
17
+}
0 commit comments