skip to main content
article

Optimizing subroutines with optional parameters in F90 via function cloning

Published: 01 August 2006 Publication History

Abstract

Optional parameters are a feature of Fortran90. The objective of this feature is to allow the F90 programmer to declare a subroutine using a number of arguments and specify a subset of these parameters as optional, which in turn, allows the programmer to omit any of these optional parameters during invocation of the subroutine. The body of such a subroutine uses an F90 intrinsic function called present(), to test whether an optional parameter has meaningful values at run-time. The optional parameter can be written/read if and only if present() returns a true value. In this work, we describe a mechanism by which such subroutines which use optional parameters can be efficiently optimized using function cloning or specialization. Function Cloning is a well-known optimization technique that creates multiple copies of a function f(), in order to exploit better optimization opportunities. We will show how cloning/specialization can be utilized such that all calls to present() can be totally eliminated in the body of such subroutines. Cloning will also result in optimization opportunities not exploitable in the original source.

References

[1]
A Methodology for Procedure Cloning, K. D. Cooper, M. W. Hall, K. Kennedy, Computer Languages, pages 105--117, 1993.
[2]
HP Fortran 90 Programmer's Reference, Jan, 1997.
[3]
Probabilistic Procedure Cloning for High-Performance Systems, S. Benker, E. Mehofer, B. Scholz, In Proc. Of Symposium on Computer Architecture and High Performance Computing, October 2000.
[4]
Selective Specialization for Object-Oriented Languages, J. Dean, C. Chambers and D. Grove.In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 146--160, 1989.
[5]
Using Path-Spectra to direct Function Cloning, T. Way and L. Pollock, In Workshop on Profile and Feedback Directed Compilation at International Conference on Parallel Architectures and Compilation Techniques, pages 40--47, 1998.
[6]
The Costs and Benefits of Cloning in a Lazy Functional Language, Karl-Philip Faxen, Trends in Functional Programming, Volume 2, 2001.
[7]
Aggressive Inlining, A. Ayers, R. Schooler, R. Gottlieb, Conference on Programming Language Design and Implementation Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and Implementation, pages 134--145, 1997.
[8]
Customization in C++, Doug Lea, Proceedings of Usenix C++ 1990.

Cited By

View all
  • (2010)Offload – automating code migration to heterogeneous multicore systemsProceedings of the 5th international conference on High Performance Embedded Architectures and Compilers10.1007/978-3-642-11515-8_25(337-352)Online publication date: 25-Jan-2010

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 41, Issue 8
August 2006
37 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1163566
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 August 2006
Published in SIGPLAN Volume 41, Issue 8

Check for updates

Author Tag

  1. compilers

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2010)Offload – automating code migration to heterogeneous multicore systemsProceedings of the 5th international conference on High Performance Embedded Architectures and Compilers10.1007/978-3-642-11515-8_25(337-352)Online publication date: 25-Jan-2010

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media