AlexVlx added inline comments.
================
Comment at: clang/lib/CodeGen/CGCall.cpp:5237-5238
+
+ if (VTy->isPointerTy() &&
+ VTy->getPointerAddressSpace() != IRTy->getPointerAddressSpace())
{
+ // In the case of targets that use a non-default address space for
----------------
arsenm wrote:
> you can also just unconditionally call CreateAddrSpaceCast and let it no-op
> if the types match
I would've if I could've:) Sadly, CastIsValid returns false for address space
casts between the same AS:
https://github.com/llvm/llvm-project/blob/ca68a7f956f24aa3882134c5d8e72659355292dc/llvm/lib/IR/Instructions.cpp#L3895,
and this makes `assert`s flare. I'm not sure if that is vestigial or just
overly cautious behaviour.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157452/new/
https://reviews.llvm.org/D157452
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits