|
|
|
|
|
by SideQuark
17 days ago
|
|
It's because the underlying optimizer follows patterns in LLVM, which is used for a lot of languages, most applicable here is C/C++, and bit things like this are used a lot for performance. The particular patterns were added to C2 just recently, being copied from the implementations in LLVM and GCC. Also it's unlikely the compiler looks for this in particular, but this falls out of a set of optimizations that do matter and it collapses into the output assembly on relevant architectures. |
|