I don't know if that's an optimization effect, but code in your example produces zero output unconditionally:
``` ps_4_0 dcl_output o0.xyzw mov o0.xyzw, l(0,0,0,0) ret ```
I don't know how this works exactly, but maybe constant arguments produce 0 derivatives, and using expression that depends on certain semantics generates actual instructions.