[PATCH] D59065: [BasicAA] Simplify inttoptr(and(ptrtoint(X), C)) to X, if C preserves all significant bits.
    Sanjoy Das via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Apr  2 19:31:23 PDT 2019
    
    
  
sanjoy added a comment.
In D59065#1449614 <https://reviews.llvm.org/D59065#1449614>, @aqjune wrote:
> > @sanjoy I haven't tried to solve this problem myself, but it seems pretty important. It sounds to me like you're laying out an argument for introducing LLVM pointer masking intrinsics that would preserve some sort of inbound property. Is it fair to say that we probably can't fully optimize tagged pointers without using intrinsics to avoid this ptrtoint optimizer trap?
>
> I think your understanding is correct. To support full optimization opportunity, an intrinsic like `llvm.ptrmask(p, mask)` would work.
I agree, but unfortunately it isn't clear to me how we can generate this intrinsic from frontend code (assuming a C++ frontend) that does pointer arithmetic by casting pointers to integers and back.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59065/new/
https://reviews.llvm.org/D59065
    
    
More information about the llvm-commits
mailing list