Use `cast` instead of `dyn_cast`. `cast` will assert fail if the value is not a BB.