Currently the InferAddressSpaces would check if the bit value doesn't
change for <ptrtoint, inttoptr> address space cast. However the
condition is too strict. Sometime only the low bit address changes for
swizzling, and the address space is not changed. Take below code as
an example, we can transform `%gp2 = inttoptr i64 %b to ptr` to
`%gp2 = inttoptr i64 %b to ptr addrspace(2)` and specify addrspace(2)
for the following store instruction.
```
%gp = addrspacecast ptr addrspace(2) %sp to ptr
%a = ptrtoint ptr %gp to i64
%b = xor i64 7, %a
%gp2 = inttoptr i64 %b to ptr
store i16 0, ptr %gp2, align 2
```
This patch tries to infer the unchanged leading bit for the address
and let the target determine if it is safe to perform address space
cast for inttoptr instruction.
---------
Co-authored-by: Yuanke Luo <ykluo@birentech.com>