Commit Graph

964 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith 7cf5fedbad Fix polly build after LLVM r234263
llvm-svn: 234266
2015-04-07 00:29:05 +00:00
David Blaikie f0e3d50d52 [opaque pointer type] More GEP API migrations
llvm-svn: 234131
2015-04-05 22:51:12 +00:00
Tobias Grosser 02cf69a6ed Make -polly-no-tiling work again
llvm-svn: 234125
2015-04-05 21:52:21 +00:00
Tobias Grosser eb18649ead Sign-extend in case of non-matching bitwidth
This change ensures that we sign-extend integer types in case non-matching
operands are encountered when generating a multi-dimensional access offset.

This fixes http://llvm.org/PR23124

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
llvm-svn: 234122
2015-04-05 17:36:42 +00:00
Tobias Grosser 2a586c387b Do not assume all multi-parameter products are affine
As soon as one operand of the product is invalid, the entire product is invalid.
This happens for example if one of the operands is not loop-invariant.

This fixes http://llvm.org/PR23125

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com
llvm-svn: 234119
2015-04-05 14:57:50 +00:00
Tobias Grosser f4c24b29e2 Make run-time alias check generation deterministic
llvm-svn: 234117
2015-04-05 13:11:54 +00:00
Tobias Grosser 7527e3f59c Do not use the POLLY vector code generator if only strip-mining is requested
This fixes http://llvm.org/PR23127

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
llvm-svn: 234113
2015-04-05 06:53:21 +00:00
Tobias Grosser 4f6bceface Do not scale tile loops
We now generate tile loops as:

 for (int c1 = 0; c1 <= 47; c1 += 1)
   for (int c2 = 0; c2 <= 47; c2 += 1)
     for (int c3 = 0; c3 <= 31; c3 += 1)
       for (int c4 = 0; c4 <= 31; c4 += 4)
         #pragma simd
         for (int c5 = c4; c5 <= c4 + 3; c5 += 1)
           Stmt_for_body3(32 * c1 + c3, 32 * c2 + c5);

instead of

 for (int c1 = 0; c1 <= 1535; c1 += 32)
   for (int c2 = 0; c2 <= 1535; c2 += 32)
     for (int c3 = 0; c3 <= 31; c3 += 1)
       for (int c4 = 0; c4 <= 31; c4 += 4)
         #pragma simd
         for (int c5 = c4; c5 <= c4 + 3; c5 += 1)
           Stmt_for_body3(c1 + c3, c2 + c5);

Run-time performance-wise this makes little difference, but this gives a large
reduction in compile time (10-30% on 17 LNT benchmarks). Apparently the isl
AST generator is not yet very efficient in generating the latter.

llvm-svn: 233675
2015-03-31 07:52:36 +00:00
Duncan P. N. Exon Smith c7ba53f9a9 DebugInfo: Use the new DebugLoc API from r233573
This should fix the build [1] after r233599 removed the old API.

[1]: http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-parallel-fast/builds/5265

llvm-svn: 233605
2015-03-30 21:47:17 +00:00
Tobias Grosser 378e003748 Drop libpluto support
We do not have buildbots or anything that tests this functionality, hence it
most likely bitrots. People interested to use this functionality can always
recover it from svn history.

llvm-svn: 233570
2015-03-30 17:54:01 +00:00
Tobias Grosser 29e36dc0c6 Update isl to 285e92aea
This is mostly a set of schedule tree enhancements which are not yet directly
useful to Polly.

llvm-svn: 233567
2015-03-30 17:28:57 +00:00
Tobias Grosser 619190d5a7 Delinearization of expressions that contain array size parameters
This allows us to delinerize code such as:

  A[][n]

  for (i
    for (j
      A[i][n-j-1] = ...

which would previously have been delinearize to an access A[i+1][-j-1].

To recover the correct access we apply the piecewise expression:

  { A[i][j] -> A[i-1][i+N]: i < 0; A[i][j] -> A[i][i]: i >= 0}

This approach generalizes to higher dimensions.

llvm-svn: 233566
2015-03-30 17:22:28 +00:00
Tobias Grosser 3cfe2e06fb Add option to only run scop detection
llvm-svn: 233556
2015-03-30 16:05:48 +00:00
Tobias Grosser 6e6c7e014a Add forgotten underscore
llvm-svn: 233534
2015-03-30 12:22:39 +00:00
Tobias Grosser 4f663aae09 Add some missing isl prefixes
llvm-svn: 233533
2015-03-30 11:52:59 +00:00
Tobias Grosser aa660a9957 Gist-simplify access relations in the context of domain constraints
This simplifies already one test case and is needed for upcoming improvements
to our delinearization.

llvm-svn: 233507
2015-03-30 00:07:50 +00:00
Tobias Grosser eefe941619 Avoid nullptr dereference in the ScopGraphPrinter
Reported-by: http://buildd-clang.debian.net/scan-build
llvm-svn: 233505
2015-03-29 22:00:54 +00:00
Johannes Doerfert be40996cfe Strip constant factors from SCoP parameters
This will strip the constant factor of a parameter befor we add it to
  the SCoP. As a result the access functions are simplified, e.g., for
  the attached test case.

llvm-svn: 233501
2015-03-29 20:45:09 +00:00
Tobias Grosser 715007216c Bail out if too many alias run-time-check comparisions would be needed
This fixes a crash observed in ffmpeg.

llvm-svn: 233480
2015-03-28 15:11:14 +00:00
Tobias Grosser 50d4e2ebf1 Use an early return on failure
llvm-svn: 233479
2015-03-28 14:50:32 +00:00
Tobias Grosser 6794238c70 Code generate parameters and run-time checks after branching new code region
When creating parameters the SCEVexpander may introduce new induction variables,
that possibly create scalar dependences in the original scop, before we code
generate the scop. The resulting scalar dependences may then inhibit correct
code generation of the scop. To prevent this, we first version the code without
a run-time check and only then introduce new parameters and the run-time
condition. The if-condition that guards the original scop from being modified by
the SCEVexpander.

This change causes some test case changes as the run-time conditions are now
introduced in the split basic block rather than in the entry basic block.

This fixes http://llvm.org/PR22069

Test case reduced by: Karthik Senthil

llvm-svn: 233477
2015-03-28 09:34:40 +00:00
Tobias Grosser 97112eeeff Fix stupid memory leak
llvm-svn: 233326
2015-03-26 22:22:33 +00:00
Tobias Grosser 2873645c51 Drop -polly-vectorizer-unroll-only option
This options was earlier used for experiments with the vectorizer, but to my
knowledge is not really used anymore. If anybody needs this, we can always
reintroduce this feature.

llvm-svn: 232934
2015-03-23 07:00:36 +00:00
Tobias Grosser bbb4cec2e8 Use schedule trees to perform post-scheduling transformations
Replacing the old band_tree based code with code that is based on the new
schedule tree [1] interface makes applying complex schedule transformations a lot
more straightforward. We now do not need to reason about the meaning of flat
schedules, but can use a more straightforward tree structure. We do not yet
exploit this a lot in the current code, but hopefully we will be able to do so
soon.

This change also allows us to drop some code, as isl now provides some higher
level interfaces to apply loop transformations such as tiling.

This change causes some small test case changes as isl uses a slightly different
way to perform loop tiling, but no significant functional changes are intended.

[1] http://impact.gforge.inria.fr/impact2014/papers/impact2014-verdoolaege.pdf

llvm-svn: 232911
2015-03-22 12:06:39 +00:00
Tobias Grosser 442c6ccb8c Add some missing __isl_give/__isl_keep annotations
llvm-svn: 232711
2015-03-19 07:43:35 +00:00
Tobias Grosser 1de4e381ca Update isl to 94d707d
The major improvements are:

  - Extended schedule tree support
  - AST generation from schedule trees

llvm-svn: 232709
2015-03-19 07:27:29 +00:00
Tobias Grosser f2716ea7d5 Add -polly-vectorizer=stripmine
By strip-mining outer loops to the innermost level we can enable LLVM's loop
vectorizer to vectorize outer loops.

llvm-svn: 232100
2015-03-12 20:48:07 +00:00
Tobias Grosser bb4126470a Drop option to prepare code for the BB vectorizer
The BB vectorizer is deprecated and there is no point in generating code for it
any more. This option was introduced when there was not yet any loop vectorizer
in sight. Now being matured, Polly should target the loop vectorizer.

llvm-svn: 232099
2015-03-12 20:47:58 +00:00
Tobias Grosser 3284f1975c Assert in isl expression builder if id can not be found [NFC]
llvm-svn: 231865
2015-03-10 22:35:43 +00:00
Tobias Grosser c98950671d Fix compilation after DataLayout was added to ScevExpander
The corresponding LLVM commit is 231740.

llvm-svn: 231793
2015-03-10 15:24:33 +00:00
Tobias Grosser ed61e1fcd1 Update PTX generator to latest LLVM changes
llvm-svn: 231652
2015-03-09 13:35:19 +00:00
Tobias Grosser 6e084ccda3 Shorten user report message slightly
llvm-svn: 231633
2015-03-09 06:59:16 +00:00
Johannes Doerfert f4af99bc6a [Formating] Fix formating
llvm-svn: 231612
2015-03-08 21:38:35 +00:00
Johannes Doerfert 7384399ddc [FIX] Add and force initialization for Pass * member
r231268 accidently dropped the initialization that is re-introduced
  here. The const will enforce initialization for the future.

llvm-svn: 231607
2015-03-08 20:14:34 +00:00
Johannes Doerfert e4bd53bd0c [FIX] Use the correct functions to extract the LB/UB from a range
The current tests will continue to cover this code and more will be
  added when non-affine loops are supported.

llvm-svn: 231606
2015-03-08 19:49:50 +00:00
Tobias Grosser 6973cb6ec7 Enable delinearization by default - second try
After having fixed the LNT bugs in the previous commits, lets reenable the
delinearization.

llvm-svn: 231595
2015-03-08 15:21:18 +00:00
Johannes Doerfert 6a4d81c1f6 Add end user report message for unprofitable regions [NFC]
llvm-svn: 231593
2015-03-08 15:11:50 +00:00
Tobias Grosser 90078c5580 Add sign-extension during codegen of index expressions
When code generating array index expressions the types of the different
components of the index expressions may not always match. We extend the type of
the index expression (if possible) and assert otherwise.

llvm-svn: 231592
2015-03-08 15:08:32 +00:00
Tobias Grosser 9d3c0b655a Revert "Enable delinearization by default"
This reverts commit 231590. Apparantly we have three more issues left
in oggenc, smg2000 and linpack.

llvm-svn: 231591
2015-03-08 12:57:31 +00:00
Tobias Grosser 16c701d0c9 Enable delinearization by default
The performance test case just committed was the last open issue I was aware of.
We enable this by default to increase test coverage and to possibly trigger
reports of issues yet unknown.

llvm-svn: 231590
2015-03-08 12:30:37 +00:00
Tobias Grosser 140b394e10 Fix compilation after 'Make DataLayout Non-Optional in the Module' commit
llvm-svn: 231362
2015-03-05 09:48:20 +00:00
Tobias Grosser 1fa434992b Fix leftover Dependences.cpp -> DependenceInfo.cpp
llvm-svn: 231355
2015-03-05 06:52:42 +00:00
Johannes Doerfert 7e6424ba5a Create a dependence struct to hold dependence information for a SCoP.
The new Dependences struct in the DependenceInfo holds all information
  that was formerly part of the DependenceInfo. It also provides the
  same interface for the user to access this information.

  This is another step to a more general ScopPass interface that does
  allow multiple SCoPs to be "in flight".

llvm-svn: 231327
2015-03-05 00:43:48 +00:00
Johannes Doerfert f6557f98a2 Rename the Dependences pass to DependenceInfo [NFC]
We rename the Dependences pass to DependenceInfo as a first step to a
  caching pass policy. The new DependenceInfo pass will later provide
  "Dependences" for a SCoP.

  To keep consistency the test folder is renamed too.

llvm-svn: 231308
2015-03-04 22:43:40 +00:00
Johannes Doerfert 3f21e27ad3 Simplify dropConstantScheduleDims [NFC]
llvm-svn: 231304
2015-03-04 22:23:21 +00:00
Tobias Grosser bb8d1562ad Remove unnecessary dynamic memory management
llvm-svn: 231281
2015-03-04 19:33:31 +00:00
Tobias Grosser 3027fedce4 Allow to build shared libraries if BUILD_SHARED_LIBS is enabled
Contributed-by: Richard Membarth <richard.membarth@uni-saarland.de>
llvm-svn: 231272
2015-03-04 18:51:27 +00:00
Tobias Grosser b021a4faad Add support for conditional 'and' and 'or' expressions
No test cases unfortunately as we do not yet generate isl_ast_op_and_then or
isl_ast_op_or_else. Those will be added in a later commit.

llvm-svn: 231268
2015-03-04 18:14:59 +00:00
Johannes Doerfert d239aac2ee Do not model scalar accesses in non-affine subregions
If a scalar was defined and used only in a non-affine subregion we do
  not need to model the accesses. However, if the scalar was defined
  inside the region and escapes the region we have to model the access.
  The same is true if the scalar was defined outside and used inside the
  region.

llvm-svn: 230960
2015-03-02 14:06:01 +00:00
Johannes Doerfert bbf3084561 [FIX] Make parallel codegen aware of region statements
llvm-svn: 230959
2015-03-02 13:41:53 +00:00