J3/04-135 Date: 16 Dec. 2003 To: J3 From: Dan Nagle Subject: Better Description of Memory- New Intents Processor speeds have increased to very much faster rates than memory speeds, compilers have improved to the point where most code sequences are nearly perfectly optimized. Separate compilation confounds "application compilers", pointers and targets complicate aliasing analysis. Therefore, more information regarding aliasing is essential for very high computational rates. The "Better Description of Memory" features attempt to define features which may provide this missing information to compilers. Since several features combine to do so, they are broken into individual papers for consideration. Title: Better Description of Memory- New Intents Submitted By: J3 Status: For Consideration References: Basic Functionality: INTENT() and INTENT( SCRATCH) Improve Dataflow Analysis. Rationale: Situations exists where Fortran's current argument intents do not correctly describe the actual dataflow. Adding two new intents greatly improves coverage of the possibilities. Estimated Impact: Compilers must recognize two new intents. High quality compilers will incorporate the new information into their dataflow analysis. Detailed Specification: INTENT() and INTENT( SCRATCH) INTENT() specifies that the actual argument is needed for disambiguation only and need not be passed to the procedure. This dummy argument may not be referenced within the procedure. INTENT( SCRATCH) specifies that the actual argument is used for scratch work space within the called procedure and passes no information in or out of the procedure. Example: interface ranf real( single_k ) function single_ranf( x) real( single_k), intent() :: x end function single_ranf real( double_k) function double_ranf( x) real( double_k), intent() :: x end function double_ranf end interface ranf then x = ranf( x) calls either single_ranf or double_ranf correctly without actually passing x. Example: subroutine worker1( temp) real, dimension( huge), intent( scratch) :: temp end subroutine worker1 and so on for worker2, etc. allows each subroutine worker to be called, perhaps from within a loop, sharing the same temp. The temp variable need not have its values computed before entering nor before exiting any worker procedure. Indeed, temp is scratch work space only in all worker procedures. In both cases, the new intents work with the dataflow analysis, rather than being a "best fit" from among choices which don't really fit. History: