Commit Graph

1458 Commits

Author SHA1 Message Date
Tobias Grosser a63b7cee66 Adding debug location information to Polly's JSCOP and dot exports
This change adds location information for the detected regions in Polly when the
required debug information is available.

The JSCOP output format is extended with a "location" field which contains the
information in the format "source.c:start-end"

The dot output is extended to contain the location information for each nested
region in the analyzed function.

As part of this change, the existing getDebugLocation function has been moved
into lib/Support/ScopLocation.cpp to avoid having to include
polly/ScopDetectionDiagnostics.h.

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

Contributed-by: Roal Jordans <r.jordans@tue.nl>
llvm-svn: 236393
2015-05-03 05:21:36 +00:00
Duncan P. N. Exon Smith ddf3a0ef38 Update polly for LLVM rename of debug info metadata with DI* prefix
Ran the same rename-md-di-prefix.sh script attached to PR23080 as in
LLVM r236120 and CFE r236121.

llvm-svn: 236127
2015-04-29 17:02:14 +00:00
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 f3ba5b5a40 Drop some unused headers
llvm-svn: 235871
2015-04-27 12:17:22 +00:00
Tobias Grosser 4245372bee Fix PTXGenerator after raw_pwrite_stream has been introduced
Without this patch Polly with GPGPU support enabled did not compile any more.

llvm-svn: 235868
2015-04-27 12:06:32 +00:00
Tobias Grosser 1346663551 Fix formatting issues in banner
llvm-svn: 235867
2015-04-27 12:02:36 +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
Johannes Doerfert 8f8af43fef Use all available range information for parameters
In the following even full-range information will help to avoid
  runtime checks for wrapping integers, hence we enable it now.

llvm-svn: 235823
2015-04-26 20:07:21 +00:00
Johannes Doerfert d5d8f67dc5 Use the original no-wrap flags for normalized AddRecs
llvm-svn: 235822
2015-04-26 19:55:21 +00:00
Tobias Grosser 2165de8894 JScoP Import/Export: Ensure parameters have the same isl_id
When reading parameters from a JSON file parameters with identical names
may be related to different isl_ids, which then causes isl to treat them
as differnet objects. This does not cause issues at the moment, but has
shown problematic in subsequent schedule tree changes.

This commit will be tested by the following changes.

llvm-svn: 235588
2015-04-23 12:23:56 +00:00
Tobias Grosser 173ecab705 Remove target triples from test cases
I just learned that target triples prevent test cases to be run on other
architectures. Polly test cases are until now sufficiently target independent
to not require any target triples. Hence, we drop them.

llvm-svn: 235384
2015-04-21 14:28:02 +00:00
Tobias Grosser 654af8f62f Fix some formatting issues
llvm-svn: 235381
2015-04-21 11:42:01 +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 b69d16ab24 Pass an actual schedule to the isl_union_access [NFC]
This change is a step towards using a single isl_schedule object throughout
Polly. At the moment the schedule is just constructed from the flat
isl_union_map that defines the schedule. Later we will obtain it directly
from the scop and potentially obtain a schedule with a non-trivial internal
structure that will allow faster dependence analysis.

llvm-svn: 235378
2015-04-21 11:01:34 +00:00
Tobias Grosser 094999bb55 Drop unneccessary -basicaa passes in DependenceInfo test cases
llvm-svn: 235374
2015-04-21 09:17:52 +00:00
Tobias Grosser 93fdc12358 Move to isl's new dependence analysis interface [NFC]
isl_union_map_compute_flow() has been replaced by
isl_union_access_info_compute_flow(). This change does not intend to
change funcitonality, yet. However, it will allow us to pass in subsequent
changes schedule trees to the dependence analysis instead of flat schedules.
This should speed up dependence analysis for important cases significantly.

llvm-svn: 235373
2015-04-21 08:47:29 +00:00
Duncan P. N. Exon Smith f06f583f1f Fix polly build after LLVM r235327
llvm-svn: 235343
2015-04-20 20:28:43 +00:00
Tobias Grosser 553af2a34c Update isl to a6523fb42c35
A minor update mostly documenting the isl coding style as well as adding
functions to inspect isl_schedule_constraints objects.

llvm-svn: 235273
2015-04-19 09:06:02 +00:00
Tobias Grosser 6f8fd8e98f Dependences: Allow to disable dependences computeout
llvm-svn: 235271
2015-04-19 07:07:26 +00:00
Tobias Grosser 5a475e7936 Drop unused extern declaration
llvm-svn: 235256
2015-04-18 15:57:56 +00:00
Tobias Grosser 4b6aa6eb8e Clear InsnToMemAcc map in ScopDetection after each runOnFunction
Otherwise, instructions in different functions that share the same pointer (due
to earlier modifications), might get assigned incorrect memory access
information (belonging to instructions in previous functions), which can result
in arbitrary memory corruption and assertion failures.

This fixes llvm.org/PR23160 and possibly also llvm.org/PR23167.

Note: InsnToMemAcc is a global variable that should never have existed in the
first place. We will clean this up in a subsequent patch.

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Debugged-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 235254
2015-04-18 11:01:25 +00:00
Tobias Grosser adfd1b730c Fix typo
llvm-svn: 235252
2015-04-18 09:40:01 +00:00
David Blaikie 556ffb7806 [opaque pointer types] Explicit non-pointer type for call expressions
(migration for recent LLVM change to textual IR for calls)

llvm-svn: 235146
2015-04-16 23:24:52 +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 c3e91b4d51 [FIX] Change old diagnostic output
llvm-svn: 234712
2015-04-12 22:53:33 +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
Tobias Grosser aa7f0f8d5c Drop ISL_INSTALL path
There is no need for an isl install path anymore. isl is now part of Polly.

llvm-svn: 234605
2015-04-10 15:41:14 +00:00
Tobias Grosser fd965b35e9 Do not recommend -polly-vectorizer=polly
Instead, we recommend -polly-vectorizer=stripmine, which pre-vectorizers outer
loops for the LoopVectorizer to take over.

llvm-svn: 234478
2015-04-09 12:10:36 +00:00
Duncan P. N. Exon Smith 7cf5fedbad Fix polly build after LLVM r234263
llvm-svn: 234266
2015-04-07 00:29:05 +00:00
Duncan P. N. Exon Smith 7431fb0257 Upgrade testcases after LLVM r234181
Until r234181 we were silently upgrading old `@llvm.dbg` intrinsics.
Fix testcases in polly that were relying on that.

llvm-svn: 234192
2015-04-06 18:25:51 +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 51b7298fa8 Adjust documentation to old -enable-polly-openmp -> -polly-parallel rename
Reported-by: Tomofumi Yuki <tomofumi.yuki@gmail.com>
llvm-svn: 234124
2015-04-05 19:52:38 +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 fe4bb1c81b [tests] Use -polly-vectorizer=polly directly
instead of defining a lit variable %vector-opt.

llvm-svn: 234112
2015-04-05 06:53:11 +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 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 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