JOE1994 wrote: `IRBuilderBase:CreatePointerCast` doesn't emit anything if the `from` and `to` targets types are same:
https://github.com/llvm/llvm-project/blob/6d7712a70c163d2ae9e1dc928db31fcb45d9e404/llvm/include/llvm/IR/IRBuilder.h#L2197-L2204 while `IRBuilderBase::CreateAddrSpaceCast` emits addrspacecast regardless: https://github.com/llvm/llvm-project/blob/6d7712a70c163d2ae9e1dc928db31fcb45d9e404/llvm/include/llvm/IR/IRBuilder.h#L2159-L2162 [LLVM LangRef says that `from` and `to` pointer types of `addrspacecast` needs to have different address spaces](https://llvm.org/docs/LangRef.html#id302) (not sure if this is outdated info) https://github.com/llvm/llvm-project/pull/112676 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits