IBM Compiler
|
-qstrictThe -qstrict option ensures that any optimization done will not alter the semantics of a program, and that the numeric results of a program will be identical with those produced by an unoptimized program. This option actually limits the amount of optimization done when it is included with any other optimization argument. Specifically, optimizations that perform operations like these are not done:
With this option, a strict computational order is observed based on the language rules for operator precedence and left to right operation regardless of the potential negative effect on performance. The following example of the potentially inhibiting effects of this argument on optimization is taken from the IBM document "Power3 Introduction and Tuning Guide", SG24-5155-00, which is available at the IBM Documentation website. When evaluating an expression like this:
A*B*C + B*C*D
an optimized compile would recognize that B*C is a "common sub-expression" and evaluate it only once. However, if -qstrict is specified, this optimization would not be done, since that would violate the left to right ordering rule on A*B*C. Since floating point arithmetic is not associative there is no guarantee the results of (A*B)*C would be bitwise identical to those of A*(B*C). In practice, we have observed that compiling with this argument rarely has a negative impact on the performance of a code. It can even be the case a code compiled with -qstrict is actually faster at run time than it was when compiled without this argument. |
![]() |
Page last modified: Mon, 24 May 2004 19:26:15 GMT Page URL: http://www.nersc.gov/nusers/resources/software/ibm/opt_options/strict.php Web contact: webmaster@nersc.gov Computing questions: consult@nersc.gov Privacy and Security Notice |
![]() |