It depends on the driver. I am sure that compilers of both Nvidia and ATI will optimize this situation, but this is not enforced by the specification. In respect to you questions shaders are like usual programs. In your case, consider using generic attributes for tangent etc. instead the texture coordinates.