The patch fixes "Virtual register does not match instruction constraint" and partly "Illegal virtual register for instruction" fails in SPIRV backend builds with LLVM_ENABLE_EXPENSIVE_CHECKS enabled. As a result the number of passed LIT tests with the enabled checks is increased from 59 to 120.
Also, support for ndrange_1D/ndrange_2D/ndrange_3D builtins is placed in a separate function.
I'd expect the class to never be set at this point (if not, I'd expect it to be always set)