This allows get_global_id to be computed in one ALU clause
I don't think you should need to look at the underlying IR value. I assume you should be seeing a GlobalAddressSDNode in the case of the ConstantExpr? You may want to look at isOffsetFoldingLegal
isa<ConstantExpr> should be redundant with isa<Constant>
New functions should start with lowercase letter
This is just a copy of condition from LowerLOAD, so I guess it can use some cleanup.
My reason to have this transformation in combiner was to have intrinsics (specifically r600_implicitarg_ptr) lowered to constants, the constant expr should be: $implicit_arg_offset + $implict_var_offset