News for hackers. Stuff that matters.
Re:GodBolt: Enter C, get Assembly by eridius on Thursday December 15, 2016 @03:08AM (#13183205)
Impressive? Those are probably specially-coded optimizations rather than the result of generic optimizations.
Re:GodBolt: Enter C, get Assembly by JoshTriplett on Thursday December 15, 2016 @03:18AM (#13183228)
As I understand it, the bswap optimization doesn't pattern-match for that specific code (and it works for any equivalent shift/mask code); it analyzes the flow of the bits to figure out the final bit pattern relative to the original, realizes the whole expression had the effect of a bswap, and substitutes a bswap.
Re:GodBolt: Enter C, get Assembly by sunfish on Thursday December 15, 2016 @11:02AM (#13185477)
Actually, in LLVM's case it really is just explicitly checking for a few specific bswap patterns rather than doing anything fancy:

https://github.com/llvm-mirror/llvm/blob/master/lib/Transfor...

Re:GodBolt: Enter C, get Assembly by dom0 on Thursday December 15, 2016 @05:39AM (#13183673)
Yes, that's called pattern matching.
Re:GodBolt: Enter C, get Assembly by IshKebab on Thursday December 15, 2016 @05:51AM (#13183730)
Not the kind of pattern matching they were talking about.