3 ms·
Impressive? Those are probably specially-coded optimizations rather than the result of generic optimizations.
by eridius 10y ago
Impressive? Those are probably specially-coded optimizations rather than the result of generic optimizations.
- JoshTriplett 10y agoAs 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.
- dom0 10y agoYes, that's called pattern matching.
- IshKebab 10y agoNot the kind of pattern matching they were talking about.
- sunfish 10y agoActually, 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/Transforms/InstCombine/InstCombineAndOrXor.cpp#L1594 https://github.com/llvm-mirror/llvm/blob/master/lib/Transfor...