<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 2, 2015, at 8:41 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Mon, Nov 2, 2015 at 5:03 AM, James Molloy via llvm-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><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;">jmolloy created this revision.<br class="">jmolloy added reviewers: manmanren, dexonsmith, joker.eph.<br class="">jmolloy added a subscriber: llvm-commits.<br class="">jmolloy set the repository for this revision to rL LLVM.<br class=""><br class="">This attribute allows the compiler to assume that the function never recurses into itself, either directly or indirectly (transitively). This can be used among other things to demote global variables to locals.<br class=""></blockquote><div class=""><br class=""></div><div class="">Where would this attribute generally come from? Is it expected that this would be exposed as a source language attribute? (any prior art there?)<br class="">Otherwise wouldn't this be an LLVM analysis, rather than a first-class IR feature?</div></div></div></blockquote><div><br class=""></div><div>The advantage of the attribute vs IR feature is that some higher level representation can populate this when generating the IR. Use cases like SIL, or the Matlab (or Julia, or Rust, or ...) generator for instance could have more information to infer this attribute than an analysis have on the pure LLVM IR semantic. Maybe the Java generator could benefit from this? (CC Sanjoy/Philip).</div><div>The attribute does not prevent an analysis that would be able populate this attribute when it is possible to infer this on the IR.</div><div>It is true that we don’t really have much data (other than the C++ main case) to support this.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </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;"><br class="">The norecurse attribute indicates that the function does not call itself either directly or indirectly down any possible call path.<br class=""><br class="">Repository:<br class=""> <span class="Apple-converted-space"> </span>rL LLVM<br class=""><br class=""><a href="http://reviews.llvm.org/D14227" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D14227</a><br class=""><br class="">Files:<br class=""> <span class="Apple-converted-space"> </span>docs/LangRef.rst<br class=""> <span class="Apple-converted-space"> </span>include/llvm/Bitcode/LLVMBitCodes.h<br class=""> <span class="Apple-converted-space"> </span>include/llvm/IR/Attributes.h<br class=""> <span class="Apple-converted-space"> </span>include/llvm/IR/Function.h<br class=""> <span class="Apple-converted-space"> </span>lib/AsmParser/LLLexer.cpp<br class=""> <span class="Apple-converted-space"> </span>lib/AsmParser/LLParser.cpp<br class=""> <span class="Apple-converted-space"> </span>lib/AsmParser/LLToken.h<br class=""> <span class="Apple-converted-space"> </span>lib/Bitcode/Reader/BitcodeReader.cpp<br class=""> <span class="Apple-converted-space"> </span>lib/Bitcode/Writer/BitcodeWriter.cpp<br class=""> <span class="Apple-converted-space"> </span>lib/IR/Attributes.cpp<br class=""> <span class="Apple-converted-space"> </span>lib/IR/Verifier.cpp<br class=""> <span class="Apple-converted-space"> </span>test/Bindings/llvm-c/invalid-bitcode.test<br class=""> <span class="Apple-converted-space"> </span>test/Bitcode/attributes.ll<br class=""> <span class="Apple-converted-space"> </span>test/Bitcode/compatibility.ll<br class=""> <span class="Apple-converted-space"> </span>test/Bitcode/invalid.ll<br class=""> <span class="Apple-converted-space"> </span>test/LTO/X86/invalid.ll<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></blockquote></div></div></blockquote></div><br class=""></body></html>