J3/04-131 Date: 16 Dec. 2003 To: J3 From: Dan Nagle Subject: Better Description of Memory- Pointers and Targets 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- Pointers and Targets Submitted By: J3 Status: For Consideration References: Basic Functionality: Improve aliasing analysis by indicating pointers to targets and targets of pointers. Rationale: Compilers must generate code which allows data to be kept in the fastest memory closest to functional units for highly optimized code sequences. Conservative assumptions regarding aliasing prevent it, providing information to allow more aggressive analysis allows it. Estimated Impact: Compilers would have to recognize lists in two new places, they should be able to detect textual falsehoods, they need not use this information when generating code. High quality implementations will do so. A forward reference must be accepted as both pointer and target cannot be declared in the same statement. Detailed Specification: Allow the programmer to list the targets of pointers and the pointers to targets, as follows: Modify the TARGET keyword by placing a parenthesized list of pointers after it, thus: real, target( pa) :: ta This indicates that only pointer pa will point to target ta. Modify the POINTER keyword analogously: real, pointer( ta) :: pa indicates that this pointer will only point to target ta. Note that one of the declarations (pa and ta) must contain a forward reference. The circumstances where one declaration of the two above is allowed to be in a different compilation unit should be resolved by J3. In general, TARGET( ) and POINTER( ) Examples: ! targets of a pointer real, pointer( t1, t2) :: ptr real, target :: t1, t2 real, target :: tgt ! compiled: ptr => t2 ! compiled not: ptr => tgt ! ----------------------------- ! pointer to a target real, pointer :: ptr real, target( ptr) :: t1, t2 real, target :: tgt ! compiled: ptr => t2 ! compiled not: ptr => tgt ! ----------------------------- ! if both, they must match real, pointer( t1, t2) :: ptr real, target( ptr) :: t1, t2 real, target :: tgt ! compiled: ptr => t2 ! compiled not: ptr => tgt History: