"Signed integers are two's complement" from CppCon is now online!
https://www.youtube.com/watch?v=JhUxIVf1qok …
-
Show this thread
-
Replying to @jfbastien
One thing I’m wondering about: How much of the perf loss from wrapping is missed loop optimizations and how much is missed algebraic optimizations? (cc
@johnregehr)1 reply 0 retweets 1 like -
Replying to @johnregehr @jfbastien
Rust doesn’t suffer from the loop optimization problems because your idiomatic loop induction variables are pointer-sized instead of 32 bits, but it might suffer from the other problems because rustc isn’t allowed to assume UB from signed overflow. How much does that matter?
1 reply 1 retweet 0 likes -
(Also idiomatic loop induction variables are unsigned in Rust)
2 replies 0 retweets 1 like -
We get back *a bit* of the benefits of overflow UB from GEP inbounds. e.g. the cited post about gcc references being able to know x[i] precedes x[i+1] and I'm pretty sure inbounds implies that (but idk how well that can back-prop to indexes themselves).https://kristerw.blogspot.com/2016/02/how-undefined-signed-overflow-enables.html …
2 replies 0 retweets 3 likes -
Yeah, my guess would be that the vast majority of the cited 12% perf loss is the loop optimization problems, because those can have cascading effects on downstream optimizations. But I don’t really know.
0 replies 0 retweets 0 likes -
All the other optimizations look like peephole const-folding ones. I would expect them to only be super high-impact if they lead to proving some massive chunk of code is dead?
1 reply 0 retweets 0 likes
OK, here’s my proposal to the C++ committee then: Go back in time and get everyone to fix their darn for loops, and then turn on -fwrapv.
-
-
Replying to @pcwalton @johnregehr
Hahahahaha I tried and the ansnwer was “no”.
1 reply 1 retweet 4 likes -
should have introduced some UB into the commitee to justify the time travel
0 replies 2 retweets 5 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.