[llvm-commits] patch: add 'halting' function attribute

Nick Lewycky nicholas at mxc.ca
Mon Jul 5 21:33:31 PDT 2010


The attached patch adds a function attribute, "halting", which models 
the assertion that a function does not have the side-effect of looping 
indefinitely. This is for llvm.org/PR965

   * modifies the asm printer and parser, LangRef and VMCore to support 
the new bit
   * all intrinsics are marked with 'halting' as they are with 'nounwind'
   * the -simplify-libcalls pass now marks certain (non-I/O) library 
functions as being halting
   * a new pass named HaltingAttr is added to mark up functions with the 
halting attribute. If necessary, it queries SCEV for an upper bound on 
the loop trip count. It is not an SCC pass.
   * Instruction::mayHaveSideEffects considers not halting to be a 
side-effect
   * Instruction::isSafeToSpeculativelyExecute will now return true for 
some call instructions (only for intrinsics marked 'readnone nounwind 
halting'). LLVM was audited to make sure this was safe, the only change 
made for it is in lib/Transforms/Scalar/Sink.cpp.

Please review!

Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: halting-1.patch
Type: text/x-patch
Size: 37162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100705/2a72acd8/attachment.bin>


More information about the llvm-commits mailing list