Software Archive
Read-only legacy content
17060 Discussões

ICPC missing an optimisation opportunity?

Martin_K_6
Principiante
402 Visualizações

Using either icpc 13.1.1 or 14.0.0 and I'm observing the same optimisation issue. A statement of the form:

[cpp]A a = A().mutator();[/cpp]

where A has an empty default ctor, could causes the compiler to route the result from the mutator via the temporary, rather than route directly to the lvalue. The drawback in the former case is that there is a superfluous copy to the lvalue.

I've attached a code sample containing two exhibits. In Exibit A the compiler eliminates the temporary; in Exibit B the compiler does not eliminate the temporary.

Compilers tested:

[bash]$ icc -V Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.1.163 Build 20130313 Copyright (C) 1985-2013 Intel Corporation. All rights reserved. .. $ icc -V Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.0.080 Build 20130728 Copyright (C) 1985-2013 Intel Corporation. All rights reserved.[/bash]

CLI options used: -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -unroll-aggressive -mmic -funroll-loops -O3 -DNDEBUG

0 Kudos
4 Respostas
Martin_K_6
Principiante
402 Visualizações

Added attachment missing from OP.

Kevin_D_Intel
Funcionário
402 Visualizações

Thank you for reporting this possible missed optimization opportunity and for the convenient test case. I routed it to Development (see internal tracking id below) and will let you know what I hear.

(Internal tracking id: DPD200247989)
(Resolution Update on 09/08/2014): This defect is fixed in the Intel® Parallel Studio XE 2015 Initial Release (2015.0.090 - Linux)

Martin_K_6
Principiante
402 Visualizações

Thank you for the quick reply, Kevin!

Kevin_D_Intel
Funcionário
402 Visualizações

The compiler changes needed to eliminate the temporary used in Exhibit B in the original test case are now available in the new Intel Parallel Studio XE 2015 release for Linux (Version 15.0.0.090 Build 20140723) now available from the Intel Registration Center.

Responder