[PATCH] D18738: Add new !unconditionally_dereferenceable load instruction metadata

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 07:50:06 PDT 2017


loladiro added a comment.

I'm a bit late to the party here, but I'm facing similar problems, so I'm interested in a clean solution. I wonder though if what we want to express isn't some sort of "type-based dereferencability annotations". For example the semantics I care about are essentially, "if you know you have a defereferencable pointer, you can go and dereference any other valid (managed) pointers the pointed to data references (recursively)". This has to be true for me, because the GC walks all pointers recursively that way. Of course the problem with this is that the compiler doesn't know which part of the referenced data are valid pointers for this purpose (and it can't just be based on the struct type, because we do store pointers to unmanaged data). So if we had a way to express to the compiler "here are the pointers in this struct that you may assume dereferencable", that would work very well for me. Would that solve your problem as well?


Repository:
  rL LLVM

https://reviews.llvm.org/D18738





More information about the llvm-commits mailing list