[llvm] [NVPTX] Check Before inserting AddrSpaceCastInst in NVPTXLoweringAlloca (PR #106127)

weiwei chen via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 14:23:37 PDT 2024


weiweichen wrote:

> Interesting, I would've though that this is allowed. However, the IR Spec says otherwise ([source](https://llvm.org/docs/LangRef.html#id301)):
> 
> > The ‘addrspacecast’ instruction takes a pointer or vector of pointer value to cast and a pointer type to cast it to, which must have a different address space.
> 
> > would it be better to remove ☝️ instead?
> 
> Since the IR spec does not allow this, we should not remove the check.

Good point! Thank you for checking the spec! Leaving the check as is and perhaps the fix in this PR makes more sense?

https://github.com/llvm/llvm-project/pull/106127


More information about the llvm-commits mailing list