I heard from a OpenCL talk using if makes the performance of kernel bad when the threads' execution path is diverged and it's better to use switch,