[PATCH] D59065: [BasicAA] Simplify inttoptr(and(ptrtoint(X), C)) to X, if C preserves all significant bits.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 13:31:48 PDT 2019


fhahn added a comment.

In D59065#1455219 <https://reviews.llvm.org/D59065#1455219>, @sanjoy wrote:

> > Ah thanks, I was missing the global nature of physical pointers. I couldn't find this described anywhere (besides some of those things mentioned at a tutorial at EuroLLVM). If this is not described anywhere, do you think it would make sense to add it to the AliasAnalysis documentation page, for example?
>
> Yes, I think we should add this to the AA docs.  I think the best reference for a consistent LLVM memory model is https://sf.snu.ac.kr/publications/llvmtwin.pdf .


Ok great. Thanks for all the input & patience. I'll try to summarize things in the AA docs when I have a bit more time!

>> Also, is the bitwise equality propagation just function local or across the whole module? If it is function-local, we might be able to convert ` inttoptr(and(ptrtoint(X), C)) ` chains to the intrinsic early on, for functions that just contain the operations to strip away the bits, or somewhere else?
> 
> Generally I don't think we can define semantics like these as function local since it would make inlining and outlining non-behavior preserving.

Right, that's what I thought. I'll take a look at clang and see if we would have access to the datalayout and if it would be feasible to generate calls to a ptrmask intrinsic.


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