HackerTrans
トップ新着トレンドコメント過去質問紹介求人

chnoblouch

2 カルマ登録 7 か月前
https://github.com/chnoblouch

投稿

Stop Making Threads

moonside.games
2 ポイント·投稿者 chnoblouch·23 時間前·0 コメント

GCC WebAssembly Back End

gcc.gnu.org
32 ポイント·投稿者 chnoblouch·8 日前·0 コメント

コメント

chnoblouch
·4 時間前·議論
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?