In terms of rendering performance, It depends on if the inputs to A and B are static or dynamic. Ie, if either one uses a Scalar parameter, it will be dynamic and every pixel will be calculating all the input branches. In that case, the IF will perform very similar to using a clamped Ceil mask with a lerp. If all the inputs are static, then in theory the shader can actually be smart enough to only run the necessary part of the branch. In practice it seems to pretty much always run both branches though.
In terms of shader compiles, I don’t have a good answer. I am not sure how the shader compiler evaluates branches and what the cost there is.
I can suggest though, that if possible you use Static Switches for anything that can be turned off completely. That will definitely help your compile times by creating more permutations and only computing the used ones.