Product News

Optimizing C++ Code: Dead Code Elimination -- Jim Hogg

We keep hearing about C++'s "as if" rule, but what does it really do? Fundamentally, it enables optimizations. A modern compiler never produces an executable that's identical to the program you actually wrote; it produces an equivalent program that's probably a lot better.

Hence Jim Hogg's nice new series on what optimizing compilers do, using Visual C++ as an example. The latest instalment:

Optimizing C++ Code : Dead Code Elimination

by Jim Hogg

From the article:

This post examines the optimization called Dead-Code-Elimination, which I’ll abbreviate to DCE.  It does what it says: discards any calculations whose results are not actually used by the program.

Now, you will probably assert that your code calculates only results that are used, and never any results that are not used: only an idiot, after all, would gratuitously add useless code -- calculating the first 1000 digits of pi, for example, whilst also doing something useful.  So when would the DCE optimization ever have an effect? ...

XL C/C++ V11.1 supports extern templates, enum class, right angle brackets -- IBM C/C++ Cafe

[Ed.: We're pleased to report continued progress toward conformance by C++ compiler vendors. This post combines three features contributed by Cecilia, christineli, and Alice Ying]

The IBM XL C/C++ V11.1 now supports several new C++11 features.

With extern templates, you can provide an explicit instantiation declaration for a template specialization if an explicit instantiation definition of the template exists in other translation units or later in the same file. If one translation unit contains the explicit instantiation definition, other translation units can use the specialization without having the specialization instantiated multiple times.

With right angle brackets, you can avoid having to write an extra space in code like vector<list<int> >, and just write vector<list<int>> the way Stroustrup intended. 

With scoped enumerations, you can avoid the following problems with the traditional enumerations:

  • Implicit conversion to an integer
  • Inability to specify the underlying type
  • Scope issue: enumerator is injected into (a.k.a. "pollutes") the enclosing scope

Enjoy!

HPX version 0.9.6 released -- Stellar Group, LSU

stellar-group.PNGThe Stellar Group at Louisiana State University has released version 0.9.6 of High Performance Parallex (HPX) for Linux, MacOS, Windows, and Android.

HPX V0.9.6 Released

The STE||AR Group is proud to announce the sixth formal release of HPX (V0.9.6). ...

From the announcement:

In this release we have made several significant changes:

  • Consolidated API to be aligned with the C++11 (and the future C++14) Standard
  • Implemented a distributed version of our Active Global Address Space (AGAS)
  • Ported HPX to the Xeon-Phi device
  • Added support for the SLURM scheduling system
  • Improved the performance counter framework
  • Added a distributed version of the Active Global Address Space (AGAS)
  • Added parcel (message) compression and parcel coalescing systems
  • Allow different scheduling polices for different parts of code with experimental executors API
  • Added experimental security support on the locality level
  • Created a native transport layer on top of Infiniband networks
  • Created a native transport layer on top of low level MPI functions
  • Added an experimental tuple-space object

Intel Concurrent Collections for C++ 0.9 now supports Xeon Phi on Windows and Linux

intel.png

Note that some of these concurrent collections are also currently being proposed for ISO standardization.

From the announcement:

Intel Releases New Version of  Intel® Concurrent Collections for C++

Intel released a new version of Intel® Concurrent Collections for C++, a library that helps developers write and tune parallel software. Now with Version 0.9, computers powered by Intel® Xeon Phi™ co-processors are supported and can experience unified programming in the same seamless way that single Intel multi-core workstations and clusters of workstations have experienced with earlier versions. Additionally, its tuning layer was extended, giving developers even easier control over the execution of their application, offering greater potential for performance, scalability and productivity.

Intel Concurrent Collections for C++ is available for Windows and Linux as a free download through the Intel Software Network.

Boost 1.54.0 released!

Release 1.54.0 of the Boost C++ Libraries is now available.

These open-source libraries work well with the C++ Standard Library, and are usable across a broad spectrum of applications.
The Boost license encourages both commercial and non-commercial use.

This release contains five new libraries and numerous enhancements and bug fixes for existing libraries.

New Libraries:
Log: Logging library, from Andrey Semashev.
TTI: Type Traits Introspection library, from Edward Diener.
Type Erasure: Runtime polymorphism based on concepts.

For details, including download links, see http://www.boost.org/users/news/version_1.54.0

You can also download directly from SourceForge: http://sourceforge.net/projects/boost/files/boost/1.54.0/

To install this release on your system, see http://www.boost.org/doc/libs/release/more/getting_started/index.html

Thanks,

--The Boost release team

LLVM 3.3 is released!

You can download either the source or prebuilt executables from the LLVM web site

Clang 3.3 includes full C++11 support, as well as a suite of run-time checkers to help find bugs in your programs.

For more information, check out the release notes for LLVM and for Clang

GCC 4.8.1 released, C++11 feature complete

The release of GCC 4.8.1 was announced today (31 May 2013) on the gcc mailing list. In addition to many bug fixes, GCC 4.8.1 adds support for C++11 ref-qualifiers, the final missing C++11 feature. This makes GCC the first C++11 [Ed.: language specification] feature complete compiler to be released.

Information on the full set of changes is available on the GCC 4.8 series page. 

Clang 3.3, also C++11 feature complete, is in release testing and the release is currently scheduled for June 5th. Within a week full C++11 support will be available from two major compilers and on numerous platforms supported by those compilers.

Forging ahead with support for the next C++ standard.

Clang reaches 100%: Fully compliant compiler expected this summer

Reported via Twitter by ISO C++ project editor Stefanus Du Toit:

Clang is C++11 feature complete as of *just now*! Here's the final commit by Richard Smith: http://llvm.org/viewvc/llvm-project?view=revision&revision=179858 … #llvm #cxx11

With Richard Smith's commit to finish thread_local support, Clang is now believed to be code-complete for full C++11 support.

As Clang usually releases twice a year, industry observers expect this means we will see at least one fully C++11-conforming commercial compiler available in the marketplace by this summer.

Congratulations, Clang development team!