<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 July 2014 14:13, <a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a> <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Updated per Nick's comment to include an explicit size (number of bytes). I currently picked 12 bits for the size, I'm not sure if that is a good choice (I did not want to use too many bits, are there only 64 in total?).<br>


<br>
Also, I renamed the AlignAttr class to IntAttr (along with all associated functions) because these are now just integer-carrying attributes (not specifically some kind of alignment).<br>
<div class=""><br>
<a href="http://reviews.llvm.org/D4449" target="_blank">http://reviews.llvm.org/D4449</a></div></blockquote><div><br></div><div>"dereferencable" vs. "dereferenceable". I think LLVM is consistently using the latter right now, your patch consistently uses the former. Please fix, either way.<br>

</div><div><br>You know how we never print "readonly readnone" because instead we just print "readnone"? (This is reflected in the API as well, querying for "onlyReadsMemory" returns true if readnone is set and readonly isn't, or if readonly is.) What do you think of doing this for "nonnull dereferencable(n)"? The only gotcha is that it only works when the pointer is in address space zero, in non-zero address spaces dereferenceable(n) does not imply nonnull.</div>

<div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">


Files:<br>
  docs/LangRef.rst<br>
  include/llvm-c/Core.h<br>
  include/llvm/Bitcode/LLVMBitCodes.h<br>
  include/llvm/IR/Argument.h<br>
  include/llvm/IR/Attributes.h<br>
</div>  include/llvm/IR/CallSite.h<br>
  include/llvm/IR/Function.h<br>
  include/llvm/IR/Instructions.h<br>
  lib/AsmParser/LLLexer.cpp<br>
  lib/AsmParser/LLParser.cpp<br>
  lib/AsmParser/LLParser.h<br>
  lib/AsmParser/LLToken.h<br>
  lib/Bitcode/Reader/BitcodeReader.cpp<br></blockquote><div><br></div><div><div>          else if (Kind == Attribute::Dereferencable)</div><div>            B.addDereferencableAttr(Record[++i]);</div><div>          else</div>

<div>            llvm_unreachable("Unknown integer attribute type");</div></div><div><br></div><div>I'm not sure that the appropriate use of llvm_unreachable. It can be reached with a crafted .bc file, right?</div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  lib/Bitcode/Writer/BitcodeWriter.cpp<br>
  lib/IR/AttributeImpl.h<br>
<div class=""><div class="h5">  lib/IR/Attributes.cpp<br></div></div></blockquote><div><br></div><div>unsigned AttributeSetNode::getDereferencableBytes() const {</div><div>  for (iterator I = begin(), E = end(); I != E; ++I)</div>

<div><br></div><div>Range-based for loop?</div><div> <br></div><div><div class=""><div class="h5">
  lib/IR/Function.cpp<br>
  lib/IR/Value.cpp<br>
  test/Bitcode/attributes.ll<br>
  test/Transforms/LICM/hoist-deref-load.ll<br>
</div></div></div></div></div></div>