←back to thread

305 points todsacerdoti | 1 comments | | HN request time: 0.202s | source
Show context
robertknight ◴[] No.44061261[source]
Good post! The inefficient code for comparing pairs of 16-bit integers was an interesting find.
replies(1): >>44061353 #
ohr ◴[] No.44061353[source]
Thanks! Would be interesting to see if Rust/LLVM folks can get the compiler to apply this optimization whenever possible, as Rust can be much more accurate w.r.t memory initialization.
replies(3): >>44061438 #>>44061766 #>>44062908 #
1. adgjlsfhk1 ◴[] No.44061766[source]
I think rust may be able to get it by adding a `freeze` intrinsic to the codegen here. that would force LLVM to pick a deterministic value if there was poison, and should thus unblock the optimization (which is fine here because we know the value isn't poison)