What's new with IBM XL C/C++ for AIX and Linux, Version 12.1

Get the highlights of the new and enhanced features in XL C/C++ Version 12.1, including support of language features that enable users to port code easily when moving to IBM Power Systems, as well as improved compilation time at commonly used optimization levels. This article is for those who have some experience with previous versions of XL C/C++.

Kelvin Li ( kli@ca.ibm.com), Advisory Software Developer, IBM

Kelvin Li is an advisory software developer on the XL compiler team in the IBM Canada Lab. He has more than 15 years of experience on developing Fortran and C frontends. He represents IBM in the OpenMP ARB and Language committees.



Melanie Steckham (steckham@ca.ibm.com), Advisory Information Developer, IBM

Melanie Steckham is an advisory information developer on the XL compiler team in the IBM Canada Lab.  She has more than 25 years of experience in writing documentation for IBM software.



11 May 2012

Also available in Chinese Russian

Introduction

XL C/C++ is a general purpose programming language compiler for IBM® AIX® and Linux platforms, geared toward tool vendors and enterprise business application developers who develop and deploy applications on IBM® Power Systems®. Enhancements introduced in Version 12.1 improve developer productivity and application performance. XL C/C++ continues to offer these advantages:

  • Ease application migration through conformance to the latest international programming language standards
  • Simplify parallel programming practices through full support for the OpenMP V3.1 API specification
  • Provide faster compile time, notably for large applications
  • Simplify programming tasks through new options, directives and functions

Enhancements introduced in Version 12.1 improve developer productivity and application performance.

This article describes the new features and enhancements in XL C/C++ for AIX and XL C/C++ for Linux, Version 12.1. It does not attempt to cover every new feature and function, nor does it attempt to describe every area in great depth. Instead, it introduces you to some of the new areas of XL C/C++ V12.1, starting with the enhancements to support language standards and then moving to parallel programming, debugging optimized code, and performance.


Language standards enhancements

With XL C/C++ V12.1, development and implementation of the features of the latest C++ language standard, ISO/IEC 14882:2011 (also known as C++11), continues.

  • The explicit conversion operators feature can be used to inhibit implicit conversions from being applied where they might be unintended, thus allowing you to program more robust classes with fewer ambiguity errors.
  • The generalized constant expressions feature extends the expression allowed within constant expressions that can be evaluated at compile time rather than at run time, thereby providing performance benefits.
  • The reference collapsing feature allows you to form a reference to a reference type using a decltype specifier, a typedef name, or a template type parameter. This feature facilitates generic and template programming.
  • The rvalue references feature allows you to reuse the resources of expiring objects. Therefore you can improve the performance of your libraries, especially if you use generic code with class types, such as template data structures. Additionally, you can consider the value category when writing a forwarding function.
  • The scoped enumeration feature now gives you the ability to declare a scoped enumeration type, an enumeration without providing enumerators, a type of enumeration, and improved type safety. This feature improves library building and security by providing better type safety. It also improves compile time and creates fewer dependencies with the introduction of forward declarations of enumerations.
  • The trailing return type feature is useful when declaring function templates or member functions of class templates with return types that depend on types of the function arguments, function or member functions of classes with complicated return types, and perfect forwarding functions. This feature improves clarity in writing function return types that are complex and that tend to introduce code cluttering.
  • The –qlanglvl=extended0x option can be used to enable most of the C++ features and all of the currently supported C++11 features in XL C/C++ V12.1.

XL C/C++ V12.1 also starts the multiphase implementation of the latest C language standard, ISO/IEC 9899:2011 (also known as C11). The following C11 features are selected to be supported in this release.

  • Anonymous structures allow all members of the anonymous structure to behave as if they were members of the parent structure for easier grouping and nesting.
  • Initialization of complex types supports infinite or NaN in the imaginary part. This provides a portable way to initialize complex types with the range of values.
  • The _Noreturn function specifier enables you to produce better-performing code by self-documenting that the functions will not return to the caller.
  • Static assertions can be declared to check important program invariants. This allows libraries to detect and diagnose common use errors at compile time.
  • The –qlanglvl=extc1x option can be used to enable the C11 features in XL C/C++ V12.1.

Parallel programming enhancements

OpenMP API is a portable, scalable programming model that offers programmers a simple, flexible standard interface for developing parallel applications for platforms, ranging from the desktop to the supercomputer. XL C/C++ V12.1 delivers full support for OpenMP V3.1, which includes the following features:

  • Final and mergeable tasks can provide further optimization opportunities in shrinking computation size scenarios.
  • The taskyield construct gives users full control of where a thread can switch from one task to another task.
  • Better thread affinity control through the OMP_PROC_BIND environment variable means that you can take advantage of the characteristic of the machine architecture.
  • Finer control of the number of threads used in nested parallelism by the OMP_NUM_THREADS environment variable so that you can express how many threads are being used in a team.
  • The atomic construct extension (read, write, capture) includes more types of atomic operation to better synchronize parallel code.

Diagnostic report enhancements

The diagnostic reports can help you identify opportunities to improve the performance of your code. With this release, these enhancements were made to the reports:

  • Compiler reports highlight the optimizations that the compiler was able to perform, as well as which optimization opportunities were missed but are now available, in both HTML and XML format. The compiler reports in HTML format are ready to be displayed. These reports provide information that can help reduce programming effort in tuning applications.
  • New sections have been added to the listing file to help you analyze your programs, including the relevance, missing, and outdated profiling data.
  • The showpdf utility is enhanced to show a view of cache-miss and value profiling information. This view of profiling information can help programmers identify possible performance bottlenecks and can lead to improved efficiency of applications.

Compile-time performance and scalability improvements

XL C/C++ Version 12.1 provides faster compile time, notably for large applications. In addition, the use of machine resources is improved by reducing the amount of memory required by the compiler, such as for pointer analysis and alias computation. Header files, which are repeatedly used in applications, are cached within the compiler to speed up overall processing during compile time. The compiler and optimizer use the greater addressability of 64-bit process, thereby allowing significantly larger programs to be optimized.


Usability enhancements

Options, directives, and functions continue to simplify programming tasks, thus shortening development time and reducing risk.

In this release, a program with multiple threads can use the new built-in functions in XL C/C++ V12.1 to atomically and safely modify data in one thread without interference from another thread. This behavior corresponds to that provided by the GNU Compiler Collection (GCC).

Several compiler options were added or enhanced. For example, the -g option is extended to improve the debugging of optimized programs. This enhancement allows you to choose between the aggressiveness of some optimizations versus the amount of accurate debug information being produced in the executable program. This approach can allow the compiler to provide debug information without trading off too much in performance opportunities. You can now debug an optimized application with this new enhancement.

The -qhaltonmsg option stops the compilation before producing any object files, executable files, or assembler source files if a specified error message is generated. The -qinfo=all option enables all diagnostic messages for all groups except als and ppt. Many suboptions were added to the -qlanglvl option to support new language standards added this release.

A group of new pragma directives were added to improve loop iterations. The iterations, max_iterations, and min_iterations pragmas allow you to provide hints to the compiler about the number of iterations that the loop will execute. This information can further improve the speed of running the program.


Summary

This article highlighted some of the more notable enhancements that have been introduced to XL C/C++ Version 12.1. This latest version includes new capabilities related to performance and application development.

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Rational software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=813466
ArticleTitle=What's new with IBM XL C/C++ for AIX and Linux, Version 12.1
publish-date=05112012