3 ms·
For some reason I couldn't 'Reply' to compiler-guy's reply directly, so I'll try here. I'm familiar with the Chris Lattner article. Most of it (especially the
by bhk 5y ago
For some reason I couldn't 'Reply' to compiler-guy's reply directly, so I'll try here.
I'm familiar with the Chris Lattner article. Most of it (especially the second installment) shows bad outcomes from UB optimization. When it comes to signed integer overflow UB, I see two examples where performance is cited as a motivation.
One mentions unrolling, and gives an example similar to one elsewhere in this thread: https://news.ycombinator.com/item?id=27223870 https://news.ycombinator.com/item?id=27223870
In my reply to that I explain how unrolling is not actually enabled by UB.
The other instance of integer overflow UB in the Lattner article is optimizing X*2/2 to X. That's perhaps a stronger case, but I haven't seen any numbers on the real-world implications of this particular optimization.
- steveklabnik 5y ago> For some reason I couldn't 'Reply' to compiler-guy's reply directly, so I'll try here. Hacker News has a timeout where if you try to reply to someone too quickly, it will hide the reply button. This timeout increases the deeper the comment tree gets.