When building with clang, the Unpredictable::any workaround will still cause multiple branches, playing havoc with the branch predictor.
Clang has a way to define a branch as being unpredictable and using that yields much better code and on the suzanne scene, my render time dropped from 81s -> 66s
The hacked way i did this was
When building with clang, the
Unpredictable::any
workaround will still cause multiple branches, playing havoc with the branch predictor. Clang has a way to define a branch as being unpredictable and using that yields much better code and on the suzanne scene, my render time dropped from 81s -> 66s The hacked way i did this wasFor the case when that isn't available, I tried using this(which works for gcc too), but clang still emitted branches here