GAP Message - remark #30535: (LOOP) Removing Exception-Handling code ...

Message

Removing Exception-Handling code associated with the loop-body may enable more optimizations for the loop at line 19. [VERIFY] Make sure that the restructured code without exception-handling code inside the loop-body follows original program semantics.

The message is emitted if "level of analysis" = extreme or -[Q]guide=4

Description

Loop optimizations could not be performed because of exception-handling code inside the loop body. You can remove the exception-handling code or use different libraries, etc.

Example

#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>

namespace ublas = boost::numeric::ublas;

int main () 
{
  unsigned size = 1000;
   
  ublas::vector<double> dest(size), src(size), arg(src);
  
  for (int i = 0; i < size; ++ i)
  {
    src(i) = i * 1.2;
    arg(i) = i * 2.3;
  }
  
  // Loop to be vectorized
  dest = src + 1.5 * arg;

  return 0;
};

For this example, the compiler is unable to vectorize the loop at -O2. Adding the -Qguide option produces the following message:

test1.cpp(19): remark #30535: (LOOP) Removing Exception-Handling code associated with the loop-body may enable more optimizations for the loop at line 19. [VERIFY] Make sure that the restructured code without exception-handling code inside the loop-body follows original program semantics.\n

This is a pointer to the user to recode maybe using a different library.

Optimization Notice in English

Per informazioni più dettagliate sulle ottimizzazioni basate su compilatore, vedere il nostro Avviso sull'ottimizzazione.
Contrassegni: