[CodeGen] Skip verify if -polly-codegen-verify is set to false
authorTobias Grosser <tobias@grosser.es>
Fri, 28 Apr 2017 19:08:20 +0000 (19:08 +0000)
committerTobias Grosser <tobias@grosser.es>
Fri, 28 Apr 2017 19:08:20 +0000 (19:08 +0000)
commitd439911f73e303383570fe05dc908c3442f678c4
treea9cd80474c5eceeefa517315a72a53b382dfb96a
parent72408fb2ac313288856c52e613274cbe321dd48e
[CodeGen] Skip verify if -polly-codegen-verify is set to false

Before this change, we always tried to verify the function and printed
verification errors, but just did not abort in case -polly-codegen-verify=false
was set and verification failed. As verification can become very cosly -- for
large functions with many scops we may verify the very same function very often
-- this can affect compile time very negatively. Hence, we respect the
-polly-codegen-verify flag with this check, ensuring that no verification is run
if -polly-codegen-verify=false.

This reduces code generation time from 26 seconds to 4 seconds on the test
case below with -polly-codegen-verify=false:

  struct X { int x; };
  void a();
  #define SIG (int x, X **y, X **z)
  typedef void (*fn)SIG;
  #define FN { for (int i = 0; i < x; ++i) { (*y)[i].x += (*z)[i].x; } a(); }
  #define FN5 FN FN FN FN FN
  #define FN25 FN5 FN5 FN5 FN5
  #define FN125 FN25 FN25 FN25 FN25 FN25
  #define FN250 FN125 FN125
  #define FN1250 FN250 FN250 FN250 FN250 FN250
  void x SIG { FN1250 }

llvm-svn: 301669
polly/lib/CodeGen/CodeGeneration.cpp