This patch prevents materializing temporaries in the address space of the references they are bind to. The temporaries should always be in the same address space - private for OpenCL.
This has been fixed earlier for the initialization of references with regular literals in https://reviews.llvm.org/D58634 but the initialization list followed slightly different code path.
@ebevhan I only now noticed your comment on the old review and I agree this doesn't look right. I will prepare another patch, just need to create a reproducer first. Sorry about the delay.
Should we be rejecting this path immediately if the address space in T1 can't be converted to from the address space of temporaries?