HackerTrans
TopNewTrendsCommentsPastAskShowJobs

chnoblouch

2 karmajoined 7 miesięcy temu
https://github.com/chnoblouch

Submissions

Stop Making Threads

moonside.games
2 points·by chnoblouch·wczoraj·0 comments

GCC WebAssembly Back End

gcc.gnu.org
32 points·by chnoblouch·8 dni temu·0 comments

comments

chnoblouch
·6 godzin temu·discuss
Looking at the optimization pipeline in Compiler Explorer (https://godbolt.org/z/rd3qber3b) after the code is converted to SSA (SROAPass), it seems that the fast version computes the pointer increment (`lwr++`) before storing `x` (`*lwr = x`), whereas the slow version does it the other way around. This happens because Clang chooses a different instruction order when generating a single statement compared to two statements.

The computation is the same, but apparently, this tiny change prevents SimplifyCFGPass from turning the code into the branchless version later on. I'm not sure why this happens, perhaps because it messes something up in the pattern recognition of the pass?