[llvm-dev] [RFC] : LLVM IR should allow bitcast between address spaces with the same size

Matt Arsenault via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 29 10:19:11 PST 2021



> On Nov 29, 2021, at 12:54, Philip Reames via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Strong -1 here.  This seems like an abuse of bitcast to avoid nailing down interfaces and semantics for restricted address space casts.  IMO, we should not accept the proposed IR change and should instead work on standardizing APIs/semantics for restricted addrspacecasts.  

I think you are misunderstanding the point of the change. The motivating example is specifically not an address space cast. The reason to do this is not to improve the optimization of no-op address space casts, although that is a potential side effect. The point is to give the IR a way to represent a cast we know is a no-op cast to represent type punning in the original program without resorting to ptrtoint/inttoptr. This is to avoid the pessimization of ptrtoint, not to make no-op addrspacecast optimizations better.

-Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211129/2293c237/attachment.html>


More information about the llvm-dev mailing list