Fixes https://github.com/llvm/llvm-project/issues/46954
The assumption that generic pointers passed to a CUDA kernel is CUDA-specific and should not be applied to non-CUDA compilations.
Addrspacecasts to global AS and back should never be applied to AS-specific pointers.
In order to make tests actually do the testing for non-CUDA compilation, we need to get
TargetMachine from the TargetPassConfig, instead of passing it explicitly as a pass constructor argument.