Warp divergence optimization (backported from 9b0d55793d98c274f6b9649e94e229d412cc8ef4)
Eliminate branch (backported from bafdf5475a3a945680ce5bcd02d08aa7a11a7d53)