OpenCL enables optimizations by default in the frontend, see getOptimizationLevel in lib/Frontend/CompilerInvocation.cpp.
It does seem a little weird that we're doing this in the frontend, this should probably be a driver feature. I must apologise for me-from-5-years-ago who implemented this in r120876.
In the meantime, maybe we should be adding -cl-opt-disable to the OpenCL codegen tests.
Adding -cl-opt-disable to the tests seems fine as an alternative short-term approach; LGTM with that approach (either as part of this change or a separate change before/after). In the long term, I agree that it would be better if the driver specified the relevant -O flag here.