[LLVMdev] Readnone/Readonly Function Attributes and Optimization

John Criswell criswell at illinois.edu
Wed Jun 20 14:26:57 PDT 2012


Dear All,

Are functions marked as readnone or readonly in the LLVM IR allowed to 
generate output or to exhibit exceptional behavior (e.g., calling 
abort(), generating an MMU fault, etc.)?

The SAFECode compiler has a set of run-time checks that pass or fail 
based solely on the input arguments and, in some cases, global state.  
They do not modify a program's global state, but they do print output on 
failures and can abort the program.  I'm wondering if adding the 
readnone/readonly attributes to these run-time checks is safe.

-- John T.




More information about the llvm-dev mailing list