[PATCH] D64954: [IR][Verifier] Allow IntToPtrInst to be !dereferenceable

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 07:35:03 PDT 2019


arsenm added inline comments.


================
Comment at: docs/LangRef.rst:8622
 attribute on parameters and return values. This metadata can only be applied
-to loads of a pointer type.
+to a pointer type.
 
----------------
rtaylor wrote:
> rtaylor wrote:
> > nhaehnle wrote:
> > > Propose a change of the wording here to: `This metadata can only be applied to certain instructions producing a pointer value.`
> > > 
> > > After all, the metadata is not applied to the type itself. Same goes in the next paragraph.
> > Are there certain instructions that produce a pointer value in which !dereferenceable cannot be applied? If so, then maybe we should list the instructions in the description(s) that it can be applied, for clarity? I'd rather not leave this as vague as "certain instructions" because the reader's first thoughts are going to be "which instructions?" Certainly if the description exists for every instruction than one could deduce it by why be vague if we don't have to?
> Also, the current Parameter Attributes reads quite simliar: This attribute may only be applied to pointer typed parameters.
> 
> So in this case, it's actually attached to the type and not the instruction?
Calls aren't allowed because they have matching attributes that are superior to the metadata. Other cases I think are less clear and may make sense to allow it in the future. 

I think this section should be split out. As is, you are just updating the notes on metadata allowed for loads. The load and inttoptr can then reference the !dereferencable section


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64954/new/

https://reviews.llvm.org/D64954





More information about the llvm-commits mailing list