Commit Graph

350 Commits

Author SHA1 Message Date
Tobias Grosser 0c55cb6071 Extract IslNodeBuilder into its own file
The IslNodeBuilder is a generic class that may be useful in other contexts
as well. Hence, we extract it into its own .h/.cpp file.

llvm-svn: 235873
2015-04-27 12:32:24 +00:00
Tobias Grosser 8fd2390053 Do not expose code generator choice in the header
There is no need for other passes to access the code-generator command-line
option. Hence, drop it from the header to simplify the interface.

llvm-svn: 235866
2015-04-27 12:02:33 +00:00
Tobias Grosser 6325cd2fcd Remove flag '-polly-annotate-alias-scopes'
This option is enabled since a long time and there does not seem to be a
situation in which we would not want to print alias scopes. Remove this option
to reduce the set of command-line option combinations that may expose bugs.

llvm-svn: 235861
2015-04-27 10:43:10 +00:00
Tobias Grosser b68068bf62 Remove implementation of getNumberOfIterations from header [NFC]
We moved this implementation into the header file to share it between
the CLooG and isl code generator. As the CLooG code generator was dropped,
the implementation can be folded back into the .cpp file.

No functional change intended.

llvm-svn: 235860
2015-04-27 10:38:45 +00:00
Tobias Grosser 5483931117 Rename 'scattering' to 'schedule'
In Polly we used both the term 'scattering' and the term 'schedule' to describe
the execution order of a statement without actually distinguishing between them.
We now uniformly use the term 'schedule' for the execution order.  This
corresponds to the terminology of isl.

History: CLooG introduced the term scattering as the generated code can be used
as a sequential execution order (schedule) or as a parallel dimension
enumerating different threads of execution (placement). In Polly and/or isl the
term placement was never used, but we uniformly refer to an execution order as a
schedule and only later introduce parallelism. When doing so we do not talk
about about specific placement dimensions.

llvm-svn: 235380
2015-04-21 11:37:25 +00:00
Tobias Grosser 5a475e7936 Drop unused extern declaration
llvm-svn: 235256
2015-04-18 15:57:56 +00:00
Tobias Grosser adfd1b730c Fix typo
llvm-svn: 235252
2015-04-18 09:40:01 +00:00
Johannes Doerfert f8206cf6d4 Allow loops in non-affine subregions -- SCoP Modeling
This will allow the ScopInfo to build the polyhedral representation for
  non-affine regions that contain loops. Such loops are basically not visible
  in the SCoP representation. Accesses that are variant in such loops are
  therefor represented as non-affine accesses.

Differential Revision: http://reviews.llvm.org/D8153

llvm-svn: 234713
2015-04-12 22:58:40 +00:00
Johannes Doerfert f3e98f44e3 Allow loops in non-affine subregions -- SCoP Detection
This will allow the ScopDetection to detect non-affine regions that
  contain loops. All loops contained will be collected and are
  accessible to later passes in order to adjust the access functions.
  As the loops are non-affine and will not be part of the polyhedral
  representation later, all accesses that are variant in these loops
  have to be over approximated as non-affine accesses. They are
  therefore handled the same way as other non-affine accesses.
  Additionally, we do not count non-affine loops for the profitability
  heuristic, thus a region with only a non-affine loop will only be
  detected if the general detection of loop free regions is enabled.

Differential Revision: http://reviews.llvm.org/D8152

llvm-svn: 234711
2015-04-12 22:52:20 +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 d654eeb862 Drop some CLooG leftovers
llvm-svn: 233572
2015-03-30 17:56:50 +00:00
Tobias Grosser 18b03e606e Delete some leftovers from scoplib
llvm-svn: 233571
2015-03-30 17:55:40 +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 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 4f663aae09 Add some missing isl prefixes
llvm-svn: 233533
2015-03-30 11:52:59 +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 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 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
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 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 6745822fd1 Add missing forward declaration [NFC]
llvm-svn: 231326
2015-03-05 00:40:07 +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
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 2495cfe01d [Refactor] Simplify ScopPass interface
llvm-svn: 230899
2015-03-01 18:43:50 +00:00
Johannes Doerfert 909a3bf21d [Refactor] Use virtual and override appropriately
+ Add override for overwritten methods.
  + Remove virtual for methods we do not want to be overwritten.

llvm-svn: 230898
2015-03-01 18:42:08 +00:00
Johannes Doerfert 3fe584d64f [Refactor] Add a Scop & as argument to printScop
This is the first step in the interface simplification.

llvm-svn: 230897
2015-03-01 18:40:25 +00:00
Johannes Doerfert 7b1b724c89 Update obsolete comment
llvm-svn: 230857
2015-02-28 17:10:06 +00:00
Johannes Doerfert 514f6efa2b [FIX] Teach RegionGenerator to respect and update dominance
When we generate code for a whole region we have to respect dominance
  and update it too.
  The first is achieved with multiple "BBMap"s. Each copied block in the
  region gets its own map. It is initialized only with values mapped in
  the immediate dominator block, if this block is in the region and was
  therefor already copied. This way no values defined in a block that
  doesn't dominate the current one will be used.
  To update dominance information we check if the immediate dominator of
  the original block we want to copy is in the region. If so we set the
  immediate dominator of the current block to the copy of the immediate
  dominator of the original block.

llvm-svn: 230774
2015-02-27 18:29:04 +00:00
Johannes Doerfert 275a1756ad Allow non-affine control flow -- Code Generation
This is the code generation for region statements that are created
  when non-affine control flow was present in the input. A new
  generator, similar to the block or vector generator, for regions is
  used to traverse and copy the region statement and to adjust the
  control flow inside the new region in the end.

llvm-svn: 230340
2015-02-24 16:16:32 +00:00
Johannes Doerfert 6cad9c4746 [FIX] Some comments
llvm-svn: 230335
2015-02-24 16:00:29 +00:00
Johannes Doerfert ff9d1980a7 Allow non-affine control flow -- SCoP Modeling
This allows us to model non-affine regions in the SCoP representation.
  SCoP statements can now describe either basic blocks or non-affine
  regions. In the latter case all accesses in the region are accumulated
  for the statement and write accesses, except in the entry, have to be
  marked as may-write.

Differential Revision: http://reviews.llvm.org/D7846

llvm-svn: 230329
2015-02-24 12:00:50 +00:00
Johannes Doerfert e70449400f Add ScalarEvolution bounds to non-affine access functions
llvm-svn: 230328
2015-02-24 11:58:30 +00:00
Johannes Doerfert ba65c1672a Allow non-affine control flow -- SCoP Detection
With this patch we allow the SCoP detection to detect regions as SCoPs
  which have non-affine control flow inside. All non-affine regions are
  tracked and later accessible to the ScopInfo.

  As there is no real difference, non-affine branches as well as
  floating point branches are covered (and both called non-affine
  control flow).  However, the detection is restricted to
  overapproximate only loop free regions.

llvm-svn: 230325
2015-02-24 11:45:21 +00:00
Johannes Doerfert b4f08eb671 [REFACTOR] Replace Pass* from BlockGen by the DomTree
llvm-svn: 230220
2015-02-23 13:51:35 +00:00
Johannes Doerfert 3f1c285294 [REFACTOR] Simplify the SCoP detection interface a bit
llvm-svn: 229879
2015-02-19 18:11:50 +00:00
Johannes Doerfert 3a7e812c66 [NFC] Generalize getIslCompatibleName interface.
llvm-svn: 229877
2015-02-19 18:09:39 +00:00
Tobias Grosser c56dcd52be Add missing comments to member variables
Reported-by: Johannes Doerfert
llvm-svn: 229854
2015-02-19 14:28:36 +00:00
Tobias Grosser d1e33e7061 ScopDetection: Only detect scops that have at least one read and one write
Scops that only read seem generally uninteresting and scops that only write are
most likely initializations where there is also little to optimize.  To not
waste compile time we bail early.

Differential Revision: http://reviews.llvm.org/D7735

llvm-svn: 229820
2015-02-19 05:31:07 +00:00
David Blaikie c4d7bc3fcc Update Polly for the removal of LLVM_DELETED_FUNCTION now that '= delete' works on all supported compilers (MSVC2012 compat has been dropped)
llvm-svn: 229344
2015-02-15 23:40:18 +00:00
Johannes Doerfert 48d75034de Add getSize() to the SCoP class.
llvm-svn: 229254
2015-02-14 12:13:17 +00:00
Chandler Carruth d01918fa13 [PM] Convert Polly over to directly use the legacy pass manager
namespace and header rather than the top-level header and using
declarations. These helpers impede modular builds and are going away.
Migrating away from them will also be necessary to start mixing in any
usage of the new pass manager.

llvm-svn: 229091
2015-02-13 09:51:50 +00:00
Johannes Doerfert 7ceb040213 Add early exits for SCoPs we did not optimize
This allows us to skip ast and code generation if we did not optimize
  a SCoP and will not generate parallel or alias annotations. The
  initial heuristic to exit is simple but allows improvements later on.

  All failing test cases have been modified to disable early exit, thus
  to keep their coverage.

  Differential Revision: http://reviews.llvm.org/D7254

llvm-svn: 228851
2015-02-11 17:25:09 +00:00
Johannes Doerfert be9c91173f [Refactor] Use only one BlockGenerator for a SCoP
This change has two main purposes:
    1) We do not use a static interface to hide an object we create and
       destroy for every basic block we copy.
    2) We allow the BlockGenerator to store information between calls to
       the copyBB method. This will ease scalar/phi code generation
       later on.

  While a lot of method signatures were changed this should not cause
  any real behaviour change.

  Differential Revision: http://reviews.llvm.org/D7467

llvm-svn: 228443
2015-02-06 21:39:31 +00:00
Johannes Doerfert 0ff23ec544 Model PHI nodes without demoting them
This allows us to model PHI nodes in the polyhedral description
  without demoting them. The modeling however will result in the
  same accesses as the demotion would have introduced.

Differential Revision: http://reviews.llvm.org/D7415

llvm-svn: 228433
2015-02-06 20:13:15 +00:00
Johannes Doerfert 4f33706b53 [NFC] Remove some unnecessary local objects
llvm-svn: 227844
2015-02-02 19:41:30 +00:00
Tobias Grosser c897af3ffc Correct a typo in a comment
llvm-svn: 227569
2015-01-30 12:33:43 +00:00
Johannes Doerfert 9e3a5db000 [FIX] Debug build + instrinsic handling
The ignored intrinsics needed to be ignored in three other places as
  well. Tests and lnt pass now.

llvm-svn: 227092
2015-01-26 15:55:54 +00:00