Commit Graph

1196 Commits

Author SHA1 Message Date
Tobias Grosser ce67a044e0 Use arguments of user statements to perform induction variable substitution
To translate the old induction variables as they exist before Polly to new
new induction variables introduced during AST code generation we need to
generate code that computes the new values from the old ones. We can do this
by just looking at the arguments isl generates in each scheduled statement.

Example:

  // Old
  for i
    S(i)

  // New
  for c0
    for c1
      S(c0 + c1)

To get the value of i, we need to compute 'c0 + c1'. This expression is readily
available in the user statements generated by isl and just needs to be
translated to LLVM-IR.

This replaces an old confusing construct that constructed during ast generation
an isl multi affine expression that described this relation and which was then
again ast generated for each statement and argument when translating the isl ast
to LLVM-IR. This approach was difficult to understand and the additional ast
generation calls where entirely redundant as isl provides the relevant
expressions as arguments of the generated user statements.

llvm-svn: 212186
2014-07-02 16:26:47 +00:00
Johannes Doerfert f618339a37 Introduce reduction types
This change is particularly useful in the code generation as we need
  to know which binary operator/identity element we need to combine/initialize
  the privatization locations.

  + Print the reduction type for each memory access
  + Adjusted the test cases to comply with the new output format and
    to test for the right reduction type

llvm-svn: 212126
2014-07-01 20:52:51 +00:00
Johannes Doerfert 9890a05287 [FIX] Don't consider reductions which are partially outside the SCoP
+ Test case

llvm-svn: 212080
2014-07-01 00:32:29 +00:00
Tobias Grosser 083d3d3cb3 [C++11] Use more range based fors
llvm-svn: 211981
2014-06-28 08:59:45 +00:00
Tobias Grosser bc4ef90802 Remove redundant code and use C++ range fors
llvm-svn: 211980
2014-06-28 08:59:38 +00:00
Johannes Doerfert 1a62c7a34a [Fix] Deleted renamed test after r211957
llvm-svn: 211964
2014-06-27 21:48:42 +00:00
Johannes Doerfert e58a012094 Allow multiple reductions per statement
Iterate over all store memory accesses and check for valid binary reduction
  candidate loads by following the operands of the stored value.  For each
  candidate pair we check if they have the same base address and there are no
  other accesses which may overlap with them. This ensures that no intermediate
  value can escape into other memory locations or is overwritten at some point.

  + 17 test cases for reduction detection and reduction dependency modeling

llvm-svn: 211957
2014-06-27 20:31:28 +00:00
Andreas Simbuerger b379edbb3e Don't expand to invalid Scops with -polly-detect-keep-going
Enabling -keep-going in ScopDetection causes expansion to an invalid
Scop candidate.

Region A     <- Valid candidate
   |
Region B     <- Invalid candidate

If -keep-going is enabled, ScopDetection would expand A to A+B because
the RejectLog is never checked for errors during expansion.

With this patch only A becomes a valid Scop.

llvm-svn: 211875
2014-06-27 06:21:14 +00:00
Johannes Doerfert 1530adffdd [Refactor] Make the used dependence types explicit
llvm-svn: 211803
2014-06-26 20:24:17 +00:00
Johannes Doerfert 76dd493eff [Fix] Broken tests after r211796.
llvm-svn: 211797
2014-06-26 19:29:11 +00:00
Johannes Doerfert 6780bc310a [Refactor] Change memory access dump to preserve space
llvm-svn: 211796
2014-06-26 18:47:03 +00:00
Johannes Doerfert f8ee915deb Use wrapped reduction dependences
This change will ease the transision to multiple reductions per statement as
  we can now distinguish the effects of multiple reductions in the same
  statement.

  + Wrapped reduction dependences are used to compute privatization dependences
  + Modified test cases to account for the change

llvm-svn: 211795
2014-06-26 18:44:14 +00:00
Johannes Doerfert ea23b1d561 Hybrid dependency analysis
This dependency analysis will keep track of memory accesses if they might be
  part of a reduction. If not, the dependences are tracked on a statement level.
  The main reason to do this is to reduce the compile time while beeing able to
  distinguish the effects of reduction and non-reduction accesses.

  + Adjusted two test cases

llvm-svn: 211794
2014-06-26 18:38:08 +00:00
Andreas Simbuerger 5bf774ce0e Use own class for storing the RejectLogs
Use a container class to store the reject logs. Delegating most calls to
the internal std::map and add a few convenient shortcuts (e.g.,
hasErrors()).

llvm-svn: 211780
2014-06-26 13:36:52 +00:00
Andreas Simbuerger 99d4ab2b84 Add diagnostic remark for ReportVariantBasePtr
llvm-svn: 211777
2014-06-26 13:33:35 +00:00
Andreas Simbuerger aee4541828 Fix dangling reference
llvm-svn: 211773
2014-06-26 11:09:13 +00:00
Andreas Simbuerger e2c924366c Support for LLVM-style RTTI isa<...>, dyn_cast<...> et al.
llvm-svn: 211770
2014-06-26 10:19:57 +00:00
Andreas Simbuerger 5569bf300d Support the new DiagnosticRemarks
Add support for generating optimization remarks after completing the
detection of Scops.
The goal is to provide end-users with useful hints about opportunities that
help to increase the size of the detected Scops in their code.

By default the remark is unspecified and the debug location is empty. Future
patches have to expand on the messages generated.

This patch brings a simple test case for ReportFuncCall to demonstrate the
feature.

Reports all missed opportunities to increase the size/number of valid
Scops:
 clang <...> -Rpass-missed="polly-detect" <...>
 opt <...> -pass-remarks-missed="polly-detect" <...>

Reports beginning and end of all valid Scops:
 clang <...> -Rpass="polly-detect" <...>
 opt <...> -pass-remarks="polly-detect" <...>

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

llvm-svn: 211769
2014-06-26 10:06:40 +00:00
Tobias Grosser 50a5e6dac0 test/ScopInfo: Remove %defaultOpts and list passes explicitly
Due to bad habit we sometimes used a variable %defaultOpts that listed
a set of passes commonly run to prepare for Polly. None of these test cases
actually needs special preparation and only two of them need the 'basicaa' to
be scheduled. Scheduling the required alias analysis explicitly makes the test
cases clearer.

llvm-svn: 211671
2014-06-25 06:38:18 +00:00
Tobias Grosser 08031390d5 Clean up XFAILed test cases
We had a set of test cases that have been incomplete and XFAILED. This patch
completes a couple of the interesting ones and removes the ones which seem
redundant or not sufficiently reduced to be useful.

llvm-svn: 211670
2014-06-25 06:31:19 +00:00
Johannes Doerfert 5e275bc83a [Refactor] Create nicer test cases from C/C++
Insert a header into the new testcase containing a sample RUN line a FIXME and
an XFAIL. Then insert the formated C code and finally the LLVM-IR without
attributes, the module ID or the target triple.

llvm-svn: 211612
2014-06-24 17:02:53 +00:00
Tobias Grosser f59b3c1d90 cmake: Fix reference to Pluto file
llvm-svn: 211591
2014-06-24 13:31:42 +00:00
Yabin Hu cc91169fd7 Remove use of llvm.codegen intrinsic for GPGPU codegen
We use llvm.codegen intrinsic to generate code for embedded LLVM-IR
strings. The reason we introduce such a intrinsic is that previous
clang/opt tools was NOT linked with various LLVM targets and their
AsmParsers and AsmPrinters. Since clang/opt been linked with all the
needed libraries, we no longer need the llvm.codegen intrinsic.

llvm-svn: 211573
2014-06-24 08:11:36 +00:00
Yabin Hu 30d7731032 Add "Yabin Hu" to CREDITS.txt
llvm-svn: 211440
2014-06-21 18:35:33 +00:00
Johannes Doerfert 5ec80c2a85 [Refactor] Simplify memory access isWrite
llvm-svn: 211379
2014-06-20 17:06:41 +00:00
Johannes Doerfert ffa73bd44c Reduction like is now a memory access property
- Remove the statement reduction like property
+ Add the reduction like property to memory accesses

llvm-svn: 211372
2014-06-20 16:58:12 +00:00
Johannes Doerfert f1906138b4 Model statement wise reduction dependences
+ Collect reduction dependences
+ Introduced TYPE_RED in Dependences.h which can be used to obtain the
  reduction dependences
+ Used TYPE_RED to prevent parallelization while we do not have a privatizing
  code generation
+ Relax the dependences for non-parallel code generation
+ Add privatization dependences to ensure correctness
+ 12 Test cases to check for reduction and privatization dependences

llvm-svn: 211369
2014-06-20 16:37:11 +00:00
Tobias Grosser 868832b3fd Update for ScopStmt iterator name change in LLVM r210927
Contributed-by: Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 211280
2014-06-19 16:45:04 +00:00
Johannes Doerfert aeed39774d Fix build
See r210927 and r210847

llvm-svn: 211278
2014-06-19 16:19:32 +00:00
Johannes Doerfert da80386700 Missing reduction detection test cases
llvm-svn: 211235
2014-06-18 23:08:14 +00:00
Johannes Doerfert 0ee1f21478 Subject: [PATCH-v5] Detect and mark reduction like statements
+ Flag to indicate reduction like statements
+ Command line option to (dis)allow multiplicative reduction opcodes
+ Two simple positive test cases, one fp test case w and w/o fast math
+ One "negative" test case (only reduction like but no reduction)

llvm-svn: 211114
2014-06-17 17:31:36 +00:00
Johannes Doerfert f675289d87 [Refactor] C++11 Memory access iterators in SCoP stmts
+ Added const iterator version
+ Changed name to begin/end to allow range loops
+ Changed call sites to range loops
+ Changed typename to (const_)iterator

llvm-svn: 210927
2014-06-13 18:01:45 +00:00
Johannes Doerfert fdd9f2b23d [Refactor] Simplify dependency map dump
llvm-svn: 210926
2014-06-13 18:00:22 +00:00
Rafael Espindola 316952a483 Fix the polly build.
llvm-svn: 210847
2014-06-12 22:37:15 +00:00
Rafael Espindola 8730ee7375 Try to fix the polly build.
llvm-svn: 210811
2014-06-12 19:22:17 +00:00
Andreas Simbuerger 06904d8554 Do not use namespace polly inside a header.
In general this fixes ambiguity that can arise from using
a different namespace that declares the same symbols as
we do.

One example inside llvm would be:
  createIndVarSimplifyPass(..);

Which can be found in:
  llvm/Transforms/Scalar.h
and
  polly/LinkAllPasses.h

llvm-svn: 210755
2014-06-12 07:26:25 +00:00
Andreas Simbuerger 24af0c8220 Fix typo
llvm-svn: 210754
2014-06-12 07:26:02 +00:00
Andreas Simbuerger 83ed861ea2 Check for an empty error log.
Fixes #19976.

The error log does not contain an error, in case we reject a candidate
without generating a diagnostic message by using invalid<>(...). This is
the case for the top-level region of a function.

The patch comes without a test-case because adding a useful one requires
additional code just for triggering it. Before the patch it would only trigger,
if we try to print the CFG with Scop error annotations.

llvm-svn: 210753
2014-06-12 07:25:08 +00:00
Andreas Simbuerger fbd643c9e1 Move getDebugLocation to ScopDetectionDiagnostic
llvm-svn: 210752
2014-06-12 07:23:04 +00:00
Tobias Grosser 8d614d0335 www: Fix grammar.
Reported-by: Jules Gagnon-Marchand <jules_gagnonm@hotmail.com>
llvm-svn: 210576
2014-06-10 20:18:16 +00:00
Tobias Grosser f4fcbf4097 Test delinearization of 2D diagonal matrix
llvm-svn: 210538
2014-06-10 14:48:17 +00:00
Tobias Grosser be7eaddc69 Adjust another test case to not access out of bounds
llvm-svn: 210208
2014-06-04 19:41:47 +00:00
Tobias Grosser 5416a0395f Adjust multidim test cases to not access out-of-bound memory
We do this currently only for test cases where we have integer offsets that
clearly access array dimensions out-of-bound.

-;   for (long i = 0; i < n; i++)
-;     for (long j = 0; j < m; j++)
-;       for (long k = 0; k < o; k++)
+;   for (long i = 0; i < n - 3; i++)
+;     for (long j = 4; j < m; j++)
+;       for (long k = 0; k < o - 7; k++)
 ;         A[i+3][j-4][k+7] = 1.0;

This will be helpful if we later want to simplify the access functions under the
assumption that they do not access memory out of bounds.

llvm-svn: 210179
2014-06-04 11:47:54 +00:00
Tobias Grosser d285161675 www: Polly can be built without any GPLed software
Thanks to Sebastian Pop and David Peixotto.

llvm-svn: 210176
2014-06-04 09:26:39 +00:00
Tobias Grosser 91f5b26268 Use range-based for loops
llvm-svn: 210170
2014-06-04 08:06:40 +00:00
Tobias Grosser d79029ab62 Fix formatting
llvm-svn: 210124
2014-06-03 20:20:41 +00:00
Sebastian Pop 422e33f363 record delinearization result and reuse it in polyhedral translation
Without this patch, the testcase would fail on the delinearization of the second
array:

; void foo(long n, long m, long o, double A[n][m][o]) {
;   for (long i = 0; i < n; i++)
;     for (long j = 0; j < m; j++)
;       for (long k = 0; k < o; k++) {
;         A[i+3][j-4][k+7] = 1.0;
;         A[i][0][k] = 2.0;
;       }
; }

; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[3 + i0, -4 + i1, 7 + i2] };
; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[i0, 0, i2] };

Here is the output of FileCheck on the testcase without this patch:

; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[i0, 0, i2] };
         ^
<stdin>:26:2: note: possible intended match here
 [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[o0] };
 ^

It is possible to find a good delinearization for A[i][0][k] only in the context
of the delinearization of both array accesses.

There are two ways to delinearize together all array subscripts touching the
same base address: either duplicate the code from scop detection to first gather
all array references and then run the delinearization; or as implemented in this
patch, use the same delinearization info that we computed during scop detection.

llvm-svn: 210117
2014-06-03 18:16:31 +00:00
Daniel Jasper 66f6f804e5 Remove superfluous semicolon confusing clang-format.
llvm-svn: 210016
2014-06-02 11:29:58 +00:00
Johannes Doerfert c3958b214c Added option for n-dimensional rectangular tiling
+ CL-option --polly-tile-sizes=<int,...,int>
  The i'th value is used as a tile size for dimension i, if
  there is no i'th value, the value of --polly-default-tile-size is
  used

+ CL-option --polly-default-tile-size=int
  Used if no tile size is given for a dimension i

+ 3 Simple testcases

llvm-svn: 209753
2014-05-28 17:21:02 +00:00
Johannes Doerfert 34558184a0 Reorder cmake include folders (polly source first)
llvm-svn: 209750
2014-05-28 16:54:42 +00:00
Tobias Grosser 704e4dee0f Fix formatting
llvm-svn: 209710
2014-05-28 04:34:58 +00:00
Sebastian Pop e0d9f5a41a delinearize does not return a remainder
llvm-svn: 209696
2014-05-27 22:42:11 +00:00
Sebastian Pop bc9009a20a pass element size to delinearization
Instead of relying on the delinearization to infer the size of an element,
compute the element size from the base address type. This is a much more precise
way of computing the element size than before, as we would have mixed together
the size of an element with the strides of the innermost dimension.

llvm-svn: 209695
2014-05-27 22:42:09 +00:00
Andreas Simbuerger 7cd0df41bf ScopDetectionDiagnostic: Update Makefile
llvm-svn: 209584
2014-05-24 18:51:14 +00:00
Andreas Simbuerger f6ee78cfb7 Expose diagnostic info to users
llvm-svn: 209575
2014-05-24 09:25:14 +00:00
Andreas Simbuerger 0447240ee9 ScopDetection: Support keep-going
Support a 'keep-going' mode for the ScopDetection. In this mode, we just keep
on detecting, even if we encounter an error.

This is useful for diagnosing SCoP candidates. Sometimes you want all the
errors. Invalid SCoPs will still be refused in the end, we just refuse to
abort on the first error.

llvm-svn: 209574
2014-05-24 09:25:10 +00:00
Andreas Simbuerger 8a00c9bb0f Substitue LastError & InvalidRegions with RejectLogs
Use the new ScopDetectionDiagnostics to implement
the same functionality.

llvm-svn: 209573
2014-05-24 09:25:06 +00:00
Andreas Simbuerger 4870e091ec Store all RejectReasons that occurred in a log.
This stores all RejectReasons created for one region
in a RejectLog inside the DetectionContext. For now
this only keeps track of the last error.

A separate patch will enable the tracking of all errors.
This patch itself does no harm (yet).

llvm-svn: 209572
2014-05-24 09:25:01 +00:00
Andreas Simbuerger 320af405d6 Split implementation from ScopDetectionDiagnostic.h
We don't want the Statistic variables in every module that
includes the diagnostics.

llvm-svn: 209571
2014-05-24 09:24:53 +00:00
Saleem Abdulrasool e653622b98 polly: update for LLVM API change
SVN r209103 removed the OwningPtr variant of the MemoryBuffer APIs.  Switch to
the equivalent std::unique_ptr versions.  This should clear up the build bots.

llvm-svn: 209104
2014-05-19 03:55:49 +00:00
Tobias Grosser 5f860fdfe9 Do not run GPGPU test cases without nvptx target
Tag the GPGPU codegen test cases as unsupported if the nvptx target is not
included in the current llvm build.

Contributed-by:  Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 208779
2014-05-14 14:18:14 +00:00
Sebastian Pop b57c0990bc fix clang format
llvm-svn: 208626
2014-05-12 20:24:26 +00:00
Sebastian Pop c5c1055e3f do not build llc and lli for polly test
llvm-svn: 208619
2014-05-12 19:43:20 +00:00
Sebastian Pop e8863b8f00 correct the delinearization failing case
collect terms from affine and non affine memory accesses

llvm-svn: 208616
2014-05-12 19:02:02 +00:00
Sebastian Pop 46e1ecdecc delinearize together all accesses to the same array
llvm-svn: 208457
2014-05-09 22:45:15 +00:00
Tobias Grosser a0e051e004 Adapt to DomTree changes in r199104
This fixes the compilation of our GPGPU code generation experiment in Polly.

Contributed-by: Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 208287
2014-05-08 08:34:23 +00:00
Sebastian Pop fcf68758b8 unxfail passing testcase
llvm-svn: 208233
2014-05-07 18:01:32 +00:00
Tobias Grosser 5e54810d37 Remove superflous semicolon
llvm-svn: 208208
2014-05-07 13:49:14 +00:00
Tobias Grosser 5196245888 Remove unnecessary struct in return type
llvm-svn: 208191
2014-05-07 11:23:35 +00:00
Tobias Grosser a3ab27e9fa Catch all functions containing a certain string
llvm-svn: 208190
2014-05-07 11:23:32 +00:00
Tobias Grosser a2125140ae Replace llvm::IRBuilder with PollyIRBuilder
Contributed-by:  Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 208182
2014-05-07 10:06:42 +00:00
Tobias Grosser ba1724da2f Remove unnecessary explicit typing in std::make_pair
Contributed-by: Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 208181
2014-05-07 10:06:33 +00:00
Tobias Grosser cfee96a444 Add the missing 'LoopToScev' parameter
Contributed-by: Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 208180
2014-05-07 10:06:23 +00:00
Tobias Grosser f56af204b9 Add delinearization testcase for ivs that do not follow the loop order
This is a test case that is currently failing, but that should start working
with an upcoming version of our delinearization pass.

llvm-svn: 207678
2014-04-30 17:49:22 +00:00
Benjamin Kramer ff69b3c260 Add missing include.
llvm-svn: 207618
2014-04-30 07:26:28 +00:00
Tobias Grosser 36e997ff80 www: Reference phone call notes
llvm-svn: 207006
2014-04-23 18:09:24 +00:00
Tobias Grosser 34c8787200 Fix formatting
llvm-svn: 206903
2014-04-22 16:39:41 +00:00
Tobias Grosser 841009a2cc We missed two files in the last commit.
Contributed-by:  Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 206901
2014-04-22 15:57:30 +00:00
Tobias Grosser 0d11dbabc4 Fixed missing cloog test with automake/configure build setup
Contributed-by:  Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 206900
2014-04-22 15:30:43 +00:00
Tobias Grosser 9818bc837a IslCodeGeneration: Document the IslExprBuilder
llvm-svn: 206898
2014-04-22 14:26:51 +00:00
Chandler Carruth 95fef9446c [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all of the header #include lines, Polly edition.

If you want to know more details about this, you can see the recent
commits to Debug.h in LLVM. This is just the Polly segment of a cleanup
I'm doing globally for this macro.

llvm-svn: 206852
2014-04-22 03:30:19 +00:00
Tobias Grosser 954939842f Really fix the load case.
Commit r206510 falsely advertised to fix the load cases, even though it only
fixed the store case. This commit adds the same fix for the load case including
the missing test coverage.

llvm-svn: 206577
2014-04-18 09:46:35 +00:00
Tobias Grosser 50fd7010d8 Ensure a scalar pointer when issuing a vector load
Even tough we may want to generate a vector load, the address from which to load
still is a scalar. Make sure even if previous address computations may have been
vectorized, that the addresses are also available as scalars.

This fixes http://llvm.org/PR19469

Reported-by:  Jeremy Huddleston Sequoia <jeremyhu@apple.com>
llvm-svn: 206510
2014-04-17 23:13:49 +00:00
Tobias Grosser 6e4dea2bb7 Link to notes of our last phone call
llvm-svn: 206488
2014-04-17 19:59:38 +00:00
Tobias Grosser 5a56cbf496 [C++11] Use nullptr
llvm-svn: 206361
2014-04-16 07:33:47 +00:00
Tobias Grosser e6c9c85bc8 Fix formatting
llvm-svn: 206333
2014-04-15 22:30:10 +00:00
Tobias Grosser 75b76729ab Fix for vector codegen in OpenMP subfunctions
Contributed-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 206332
2014-04-15 22:30:06 +00:00
Tobias Grosser c787b12d04 Avoid -Wunused-const-variable warning
llvm-svn: 206329
2014-04-15 22:18:37 +00:00
Chandler Carruth 1fc97224af Fix more build errors in Polly after r206310. David caught one of these
in r206312, but others don't seem to show up on build bots? Unsure of
why, they showed up for me.

llvm-svn: 206326
2014-04-15 21:48:34 +00:00
Tobias Grosser 364c136d08 Dependences: Do not fail in case a schedule eliminates all dependences
The following example shows a non-parallel loop

void f(int a[]) {
  int i;
  for (i = 0; i < 10; ++i)
    A[i] = A[i+5];
}

which, in case we import a schedule that limits the iteration domain
to 0 <= i < 5, becomes parallel. Previously we crashed in such cases, now we
just recognize it as parallel.

This fixes http://llvm.org/PR19435

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
llvm-svn: 206318
2014-04-15 20:14:57 +00:00
David Blaikie b035f6d878 Blind fix Polly for r206310
llvm-svn: 206312
2014-04-15 18:45:27 +00:00
Tobias Grosser efc3013544 Codegeneration: Free memory correctly when using -polly-vectorizer=polly
This fixes PR19421.

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
llvm-svn: 206156
2014-04-14 08:33:24 +00:00
Tobias Grosser 8e5e78e19b Update isl to fix memory bugs
llvm-svn: 206134
2014-04-13 16:37:18 +00:00
Tobias Grosser c393ff07b2 Dependences: Refine the compute out facility
We update to a newer version of isl, which includes changes to the compute
out facility that make it a lot more predicable. With our new value, we can
reliably bail out for all reported bugs, while still being able to compute
dependences for all but two test cases in the LLVM test suite. For the remaining
two test cases, the dependence problem we construct is unnecessarily complex,
so there is hope we can improve on this. However, to avoid any future issues,
having a reliable compute out facility in place is important.

llvm-svn: 206106
2014-04-12 11:39:28 +00:00
Tobias Grosser 20532b8e1b Fixed gcc build warnings
+ vim 'fixed' line endings in json_value.cpp

Contributed-by:  Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 206044
2014-04-11 17:56:49 +00:00
Tobias Grosser b24cf90645 Remove OpenScop
We only supported a very old version of OpenScop that was entirely different
to what OpenScop is today. To not confuse people, we remove this old and
unusable support. If anyone is interested to add OpenScop support back in,
the relevant patches are available in version control.

llvm-svn: 206026
2014-04-11 09:47:45 +00:00
Tobias Grosser 4f469d65cc todo: Update todo list
llvm-svn: 205985
2014-04-10 19:49:36 +00:00
Tobias Grosser fc8d81e5cb www: Fix typo
llvm-svn: 205984
2014-04-10 19:21:12 +00:00
Tobias Grosser 884f6ad09b todo: Building against an installed LLVM works
We only care about cmake and the buildbots test that it works.

llvm-svn: 205983
2014-04-10 19:20:30 +00:00
Tobias Grosser 52bacf5900 www: We have no interest in FORTRAN support in test suite
llvm-svn: 205982
2014-04-10 19:19:11 +00:00
Tobias Grosser 7701194d61 Add link to meeting notes
llvm-svn: 205980
2014-04-10 18:44:50 +00:00
Sebastian Pop cd3bb59aa2 only delinearize when the access function is not affine
llvm-svn: 205971
2014-04-10 16:08:11 +00:00
Tobias Grosser 79baa21242 ScopInfo: Scalar accesses are zero dimensional
llvm-svn: 205958
2014-04-10 08:38:02 +00:00
Tobias Grosser 6defb5bd6d ScopInfo: Some code cleanup
llvm-svn: 205957
2014-04-10 08:37:44 +00:00
Sebastian Pop e4c20da3e7 clang format last patch
llvm-svn: 205804
2014-04-08 21:37:58 +00:00
Sebastian Pop 1801668af3 delinearize memory access functions
llvm-svn: 205799
2014-04-08 21:20:44 +00:00
Tobias Grosser 72cebdec2e Add another hint for fixing check-polly errors to get_started.html
Reversed the order in which LD_LIBRARY_PATH is defined in order to make sure the
${CLOOG_INSTALL} prefix is found first.

Contributed-by: Christian Bielert <cib123@googlemail.com>
llvm-svn: 205556
2014-04-03 19:38:38 +00:00
Tobias Grosser d7c5e51627 Note of last Polly phone call
llvm-svn: 205553
2014-04-03 18:56:13 +00:00
Tobias Grosser ca61be3ac2 Add a paragraph describing how to configure the python interpreter.
Contributed-by: cib123@googlemail.com
llvm-svn: 205549
2014-04-03 18:12:13 +00:00
Tobias Grosser 2610889ebc Use explit types in foreach iterators
llvm-svn: 205457
2014-04-02 20:18:19 +00:00
Andreas Simbuerger 01a37a0bcc Replace INVALID/INVALID_NOVERIFY with diagnostics.
This replaces the ancient INVALID/INVALID_NOVERIFY macros with a real
function.

The new invalid(..) function uses small diagnostic objects that are
generated on demand. We can store arbitrary additional information per
error type and generate useful debug/error messages on the fly.

Use it as follows:
  if (/* Some error condition (ReportFoo) */)
    invalid<ReportFoo>(Context, /*Assert=*/true/false,
      (/* List of helpful diagnostic objects */));

Where ReportFoo is a subclass of RejectReason that is able to take the
list of helpful diagnostic objects in its constructor.
The implementation of invalid will create the report and fire
an assertion, if necessary.

llvm-svn: 205414
2014-04-02 11:54:01 +00:00
Tobias Grosser 64b95123ef Delete trivial PHI nodes (aka stack slot sharing)
During code preperation trivial PHI nodes (mainly introduced by lcssa) are
deleted to decrease the number of introduced allocas (==> dependences). However
simply replacing them by their only incoming value would cause the independent
block pass to introduce new allocas. To prevent this we try to share stack slots
during code preperarion, hence to reuse a already created alloca 'to demote' the
trivial PHI node. This works if we know that the value stored in this alloca
will be the incoming value of the trivial PHI at the end of the predecessor
block of this trivial PHI.

Contributed-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 205320
2014-04-01 16:01:33 +00:00
Tobias Grosser 5fa36c0ff6 Updated test/create_ll.sh to work with old & new clang versions.
We explicitly specifying all filenames instead of assuming some naming
convention used by clang and opt.

Contributed-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 204726
2014-03-25 15:50:44 +00:00
Tobias Grosser e275e9216b Return conservative result in case the dependence check timed out
For complex examples it may happen that we do not compute dependences. In this
case we do not want to crash, but just not detect parallel loops.

llvm-svn: 204470
2014-03-21 15:12:09 +00:00
Tobias Grosser 2f4529f864 clang-format: Remove empty lines
llvm-svn: 204468
2014-03-21 14:04:25 +00:00
Tobias Grosser 105ddd8775 www: More formatting improvements
llvm-svn: 204466
2014-03-21 13:38:02 +00:00
Tobias Grosser 93679896c6 www: Remove warning about the implementation status
It does not seem to add a lot of value, as it leaves unclear which parts are
mature and whichs not. Adding this informatin also does not make sense, as it
changes rapidly.

llvm-svn: 204447
2014-03-21 09:34:38 +00:00
Tobias Grosser ca493da8a4 www: Rewrite the intro about Polly
llvm-svn: 204446
2014-03-21 09:34:34 +00:00
Tobias Grosser 54ef29a8bb www: Mark a couple of projects done
We now have both polyhedral dead code elimination as well as LNT buildbots.

llvm-svn: 204445
2014-03-21 09:34:30 +00:00
Tobias Grosser 231f094ed9 www: Add a script that allows us to obtain statistics about polly
llvm-svn: 204444
2014-03-21 09:34:27 +00:00
Tobias Grosser 9e8597bdb7 www: Add a script to show the latest news from polyhedral.info
llvm-svn: 204443
2014-03-21 09:34:23 +00:00
Tobias Grosser eb4ea9eb79 www: Separate out the Polly paper
llvm-svn: 204442
2014-03-21 09:34:18 +00:00
Tobias Grosser 7e1faccca2 www: Link to the polyhedral.info publication list
llvm-svn: 204441
2014-03-21 09:34:13 +00:00
Sebastian Pop 763699760e [www] announce static links of polly in tools
llvm-svn: 204265
2014-03-19 21:31:09 +00:00
Tobias Grosser 0dd463facf Support for generating vectors for loads with -1 stride
This patch enables vectorization of loops containing backward array
traversal (array stride is -1).

Contributed-by: Chris Jenneisch <chrisj@codeaurora.org>
llvm-svn: 204257
2014-03-19 19:27:24 +00:00
Tobias Grosser 806e9fff60 Move Pass registration into polly library
This ensures that the polly passes get properly registered both, when using
polly as a loadable module and when directly linking it into clang/opt/bugpoint.

llvm-svn: 204255
2014-03-19 17:54:23 +00:00
Tobias Grosser 4eb7ddb13a Fix source code formatting
llvm-svn: 204169
2014-03-18 18:51:11 +00:00
Tobias Grosser 72ceb7bc73 Dependences: Further reduce the allowed compile time
llvm.org/PR19081 reports that the polly dependence analysis causes some h264
compilation to hang. We adjust the compute out, to ensure we do not block on
expensive dependence calculations.

llvm-svn: 204168
2014-03-18 18:51:04 +00:00
Tobias Grosser 67f1524797 autoconf: Add PLUTO_FOUND flag
This fixes llvm.org/PR12250.

Contributed-by: Sam Novak <snovak@uwsp.edu>
llvm-svn: 204167
2014-03-18 18:50:58 +00:00
Tobias Grosser 483fdd4b7f Print function and region name in scop description
llvm-svn: 204165
2014-03-18 18:05:38 +00:00
Andreas Simbuerger 84e0723af8 (Make) Remove unused Makefiles
llvm-svn: 203957
2014-03-14 18:25:31 +00:00
Andreas Simbuerger 3c9a0d05cd (Make) Build a single monolithic LLVMPolly.so
This reverts the broken modularized build.

This builds the classic loadable module. The separation
of library and plugin is yet to be done in a future patch.

llvm-svn: 203952
2014-03-14 18:02:06 +00:00
Tobias Grosser 8111a0ae7d autoconf: Fix module loading in tests
llvm-svn: 203925
2014-03-14 13:27:26 +00:00
Sebastian Pop 7537be92f4 add -load polly.so only when not LINK_POLLY_INTO_TOOLS
llvm-svn: 203888
2014-03-14 04:04:36 +00:00
Tobias Grosser 09f459719e [libpluto] Make more pluto options accessible
Contributed-by: Sam Novak <snovak@uwsp.edu>
llvm-svn: 203871
2014-03-13 23:37:48 +00:00
Tobias Grosser 64e8e37dee Allow several polly command line options to be provided multiple times
Contributed-by: Sam Novak <snovak@uwsp.edu>
llvm-svn: 203869
2014-03-13 23:37:43 +00:00
Tobias Grosser 1f1c916074 [autoconf] Add Transform/ directory
Contributed-by: Sam Novak <snovak@uwsp.edu>
llvm-svn: 203868
2014-03-13 23:37:37 +00:00
Tobias Grosser 8c26761018 [cmake] There is only one PoCC file, and this is in /Transforms
llvm-svn: 203861
2014-03-13 22:38:50 +00:00
Sebastian Pop ee605bc17c update comment
llvm-svn: 203859
2014-03-13 22:07:17 +00:00
Sebastian Pop 96e9ed71ea add intrinsics_gen dependence on Polly
to avoid build errors like this:
In file included from ../include/llvm/IR/IntrinsicInst.h:30:0,
                 from ../tools/polly/lib/CodeGen/BlockGenerators.cpp:28:
../include/llvm/IR/Intrinsics.h:41:34: fatal error: llvm/IR/Intrinsics.gen: No such file or directory

The earlier change in commit b1d2e6d5c3ce151ef6b7213c00019715e63d7cfb has been
accidentally reverted in:

commit 6b1963814877f5b1b161d3a73a3c8246c4ad4787
Author: simbuerg <simbuerg@91177308-0d34-0410-b5e6-96231b3b80d8>
Date:   Tue Mar 11 21:26:06 2014 +0000

    Refactor Polly's Pass creation and initialization.

    Rename some files and adjust cmake accordingly

llvm-svn: 203843
2014-03-13 20:29:19 +00:00
Sebastian Pop a8fb72428b record in POLLY_LINK_LIBS all the libs needed for polly
llvm-svn: 203841
2014-03-13 20:24:48 +00:00
Sebastian Pop 0c9de71eca avoid warning
warning: multi-line comment [-Wcomment]
llvm-svn: 203811
2014-03-13 16:28:02 +00:00
Rafael Espindola 80f20133d4 Fix polly tests to not include aliases to declarations.
llvm-svn: 203721
2014-03-12 21:48:42 +00:00
Sebastian Pop 1b57e8f028 add dependence of check-polly on llc
to avoid an error when directly doing ninja check-polly after cmake
'Could not find llc in .../ninja/bin'.

llvm-svn: 203696
2014-03-12 18:55:25 +00:00
Andreas Simbuerger 8dbe338fb1 Refactor Polly's Pass creation and initialization.
Rename some files and adjust cmake accordingly

llvm-svn: 203609
2014-03-11 21:26:06 +00:00
Andreas Simbuerger 7f97f8cb0f (cmake) rename polly's shared lib.
llvm-svn: 203608
2014-03-11 21:26:02 +00:00
Andreas Simbuerger 19523ed2be Move transformations into own directory
Move all transformations into their own directory. CMakeLists are
adjusted accordingly.

llvm-svn: 203607
2014-03-11 21:25:59 +00:00
Tobias Grosser 4ba60fe9eb ScheduleOptimizer: Fix prevectorization.
In case we are at the innermost band, we try to prepare for vectorization. This
means, we look for the innermost parallel loop and strip mine this loop to the
innermost level using a strip-mine factor corresponding to the number of vector
iterations.

For whatever reason, the code that implemented this feature was broken. We now
added a comment, a test case and obviously also the right code.

llvm-svn: 203544
2014-03-11 06:27:36 +00:00
Tobias Grosser ab38488c96 Ported scoplib to use isl_val * instead of isl_int
1) The isl_int -> isl_val changes are the ones Tobias suggested.
   One additional isl_val_free is added (and needed)
2) Three scoplib_vector_free are added, maybe we would need even
   more (and matrix_free) but it's hard to place them right.
3) Cleaned the includes (and removed 'extern C')

This fixes the broken compilation for the scoplib import and export.

Contributed-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 203500
2014-03-10 22:03:30 +00:00
Sebastian Pop 3e58bb2182 add intrinsics_gen dependence on LLVMPollyLib
to avoid build errors like this:
In file included from ../include/llvm/IR/IntrinsicInst.h:30:0,
                 from ../tools/polly/lib/CodeGen/BlockGenerators.cpp:28:
../include/llvm/IR/Intrinsics.h:41:34: fatal error: llvm/IR/Intrinsics.gen: No such file or directory

llvm-svn: 203495
2014-03-10 21:45:53 +00:00
Tobias Grosser e655754d57 Update CLooG and some test cases
This is necessary to avoid test failures in the CLooG test suite due to the
recent isl update.

We also need to update two polly test cases which rely on a certain order in the
textual description that isl chooses for its sets and maps. Changes here are not
often, but we should probably switch to a check that verifies such maps are
semantically equivalent instead of represented identically.

llvm-svn: 203476
2014-03-10 17:31:22 +00:00
Tobias Grosser 728051e7df Update isl to ensure 'extern "C" {' is available
Older isl versions did not properly guard all function declarations for the
use in C++. Specifically, the isl/val_gmp.h header was not properly guarded.
This patch ensures we have the proper guards in place and do not accidentally
link to name-mangled C++ versions of those functions that are not available in
libisl.so.

llvm-svn: 203462
2014-03-10 13:46:52 +00:00
Tobias Grosser b2b307e7be www: Fix link to Pluto
llvm-svn: 203456
2014-03-10 12:28:20 +00:00
Chandler Carruth b566902687 [C++11] Update to reflect the Value::use_iterator and
Value::user_iterator changes in LLVM r203364. Converts several of these
loops to nice range based loops in the process.

Built and tested cleanly for me, yay for being able to fully build and
test Polly changes!

llvm-svn: 203381
2014-03-09 08:29:29 +00:00
Sebastian Pop 9cce17a23a remove unused code
llvm-svn: 203163
2014-03-06 20:59:18 +00:00
Chandler Carruth 6b96c2447e [Layering] Update include of DebugInfo.h which moved to the IR library
in LLVM r203046.

llvm-svn: 203049
2014-03-06 00:47:27 +00:00
Tobias Grosser 7ff8ae8967 Fix formatting
llvm-svn: 202856
2014-03-04 15:57:29 +00:00
Tobias Grosser 9e400b076f Always name instructions
We currently need to always name instructions, as the polly test suite currently
matches for certain names. We should improve the test suite at some point.

This fixes 'make check-polly' in NDEBUG builds.

llvm-svn: 202855
2014-03-04 15:43:57 +00:00
Tobias Grosser 37c9b8e0f2 Emit llvm.loop metadata for parallel loops
For now we only mark innermost loops for the loop vectorizer.  We could later
also mark not-innermost loops to enable the introduction of openmp parallelism.

llvm-svn: 202854
2014-03-04 14:59:00 +00:00
Tobias Grosser 5103ba7c91 Introduce PollyIRBuilder
PollyIRBuilder is currently just a typedef to IRBuilder<>. Consequently, this
change should not affect behavior. In subsequent patches we will extend its
functionality to emit loop.parallel metadata.

llvm-svn: 202853
2014-03-04 14:58:49 +00:00
Chandler Carruth c3478b9367 [Modules] Update to reflect the move of CFG.h to the IR library in LLVM
r202827.

llvm-svn: 202830
2014-03-04 11:47:37 +00:00
Tobias Grosser fed08ff6de And some formatting fixes
llvm-svn: 202766
2014-03-03 22:39:48 +00:00
Tobias Grosser 0ab5004f9e Commit missing PollyModule.cpp file
llvm-svn: 202764
2014-03-03 22:23:38 +00:00
Tobias Grosser 2c1a81aefd cmake: Split off functionality for LLVM loadable module
This fixes the buildbots who failed, because the linker eliminated most of the
Polly functionality when building without BUILD_SHARED_LIBS=ON.

Besides fixing the build, this change also brings additional functionality. With
the new separation between the general polly libraries and the functionality for
the polly module, it is now possible to link polly directly into a tool instead
of using requiring users to load a shared library.

llvm-svn: 202762
2014-03-03 21:58:50 +00:00
Tobias Grosser 23f16b1ceb cmake: build monolithic libLLVMPollyLib.dylib
The module LLVMPolly.so links to that. There is really no reason to build a
large number of mini-libraries here, especially as we do have dependences
between the libraries that are not properly handled and that make linking fail
on darwin.

Submitted-by: David Fang  <fang@csl.cornell.edu>
llvm-svn: 202743
2014-03-03 19:30:19 +00:00
Tobias Grosser 1d191909a8 [C++11] Use foreach iterator for blocks and operands
llvm-svn: 202707
2014-03-03 13:13:55 +00:00
Tobias Grosser b5846f9e15 ScopDetect: Make foreachs 'const auto &'
We mostly iterate over read-only values. Following a suggestion by Duncan P.N
Exons Smith, we use the construct 'const auto &' for this.

llvm-svn: 202651
2014-03-02 17:05:27 +00:00
Tobias Grosser 45bac0d953 Use C++11 formatting
clang-formats behaviour has changed for a couple of C++11 formattings. We adapt
Polly to ensure our formatting checks are clean again.

llvm-svn: 202650
2014-03-02 17:05:21 +00:00
Tobias Grosser e8fa99b276 PollyDectect: Use spaces before foreach colons
clang-format requires a space before the ":" in the foreach loop. Even though
this is surprising to me, we follow this style to make our formatting
consistent with clang-format. I found that this clang-format style is used in a
couple of C++11 examples, hence I believe the fact that clang-format adds a
colon is not a bug but just something I was not used to yet.

llvm-svn: 202648
2014-03-02 16:28:24 +00:00
Tobias Grosser 00dc309a08 C++11: Use foreach in ScopDetection
llvm-svn: 202634
2014-03-02 12:02:46 +00:00
Tobias Grosser 4e9069291a cmake: Do not link in system libs
They are not needed any more.

llvm-svn: 202481
2014-02-28 10:11:20 +00:00
Rafael Espindola c5d1689b45 Update for llvm api change.
llvm-svn: 202183
2014-02-25 19:17:57 +00:00
Rafael Espindola d288d9aa94 Update for llvm api change.
llvm-svn: 202056
2014-02-24 18:21:12 +00:00
Rafael Espindola 3f4ace1611 Update for llvm API change.
llvm-svn: 202048
2014-02-24 16:26:33 +00:00
Tobias Grosser 356faa8f09 Dead code elimination: Schedule another approximative step before actual DCE
In 'obsequi' we have a scop in which the current dead code elimination works,
but the generated code is way too complex. To avoid this trouble (and to not
disable the DCE entirely) we add an additional approximative step before
the actual dead code elimination. This should fix one of the two current
nightly-test issues.

Polly could be improved to handle 'obsequi' by teaching it to introduce only a
single parameter for (%1 and zext %1) which halves the number of parameters and
allows polly to derive a simpler representation for the set of live iterations.
However, this needs some time to investigate.

I will commit a test case as soon as we have a reduced one.

llvm-svn: 202010
2014-02-24 08:52:20 +00:00
Tobias Grosser 472d3b7037 codegen: Update LoopInfo correctly
Add the 'polly.start' basic block to the loop that surrounds the scop we just
codegenerate.

This fixes PR13441

llvm-svn: 202000
2014-02-24 00:50:49 +00:00
Tobias Grosser ad02500526 Cloog: Compute simple hulls during code generation
Sven suggested to use this simpler code generation strategy as the convex_hull
computation is apparently rather inefficient. We do not have a test case that
shows a difference, but, in case we find a test case where this makes a
difference, we can reconsider our decission.

llvm-svn: 201997
2014-02-23 22:39:37 +00:00
Tobias Grosser 38c36ea18e Do not fail in case we do not have valid dependences
In case we do not have valid dependences, we do not run dead code elimination or
the schedule optimizer. This fixes an infinite loop in the dead code
elimination (PR12110).

llvm-svn: 201982
2014-02-23 15:15:44 +00:00
Rafael Espindola fa0841c78f Set CMAKE_INSTALL_RPATH_USE_LINK_PATH to true.
This will make sure polly finds libisl.so at runtime even if the parent
CMakeLists.txt sets CMAKE_INSTALL_RPATH.

llvm-svn: 201935
2014-02-22 13:28:31 +00:00
Sebastian Pop bfec361cae GMP is only required for CLooG
llvm-svn: 201925
2014-02-22 02:15:39 +00:00
Tobias Grosser fa1a4320af Dependences: Do not assign 'WAW' twice
Reported-by: Sebastian Pop <spop@codeaurora.org>
Reported-by: Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 201903
2014-02-21 23:08:58 +00:00
Tobias Grosser 88640d2b47 Use -polly-codegen-isl in isl-codegen test
Reported-by: Sebastian Pop <spop@codeaurora.org>
llvm-svn: 201902
2014-02-21 23:08:54 +00:00
Tobias Grosser e87e0343de Dependences: Eliminate warning about possibly uninitialized pointers
llvm-svn: 201898
2014-02-21 22:45:48 +00:00
Tobias Grosser 0bc0ad07bc Fix formatting
llvm-svn: 201891
2014-02-21 21:06:08 +00:00
Tobias Grosser 55eb7ef64f Enable polyhedral dead code elimination by default
llvm-svn: 201889
2014-02-21 20:51:50 +00:00
Tobias Grosser 817d51dd1b DCE: Switch to hybrid precise-unprecise analysis
Instead of giving a choice between a precise (but possibly very complex)
analysis and an approximative analysis we now use a hybrid approach which uses N
precise steps followed by one approximating step. The precision of the analysis
can be changed by increasing N. With a default of 'N' = 2, we get fully precise
results for our current test cases and should not run into performance problems
for more complex test cases. We can adjust this value when we got more
experience with this dead code elimination.

llvm-svn: 201888
2014-02-21 20:51:46 +00:00
Tobias Grosser ecae17ffca DCE: Update description
llvm-svn: 201887
2014-02-21 20:51:40 +00:00
Tobias Grosser 34f0613562 Optimizer: Do not accidentally set schedule to NULL
In case the domain of a statement is empty, the schedule optimizer set by
accident the schedule to a NULL pointer. This is incorrect. Instead, we set
it to an empty isl_map with zero schedule dimensions. We already checked for
this in our test cases, but unfortunately the test cases did not fail as
expected. The assert we add in this commit now ensures that the test cases
fail properly in case we regress on this again.

llvm-svn: 201886
2014-02-21 20:51:36 +00:00
Tobias Grosser 030237d0ff Codegen: Do not crash when seeing debug intrinsics
We now skip the debug intrinsics which is a lot better than crashing due to
uncopied metadata references. We should step by step investigate which debug
intrinsics we can copy without trouble.

We still keep the debug location metadata.

llvm-svn: 201860
2014-02-21 15:06:05 +00:00
Tobias Grosser 37eb422f69 Add polyhedral dead code elimination.
This pass eliminates loop iterations that compute results that are not used
later on. This can help e.g. in D, where the default zero-initialization is
often unnecessary if right after new values are assigned to an array.

Contributed-by: Peter Conn <conn.peter@gmail.com>
llvm-svn: 201817
2014-02-20 21:43:54 +00:00
Tobias Grosser 3fc9154c40 Fix formatting
llvm-svn: 201816
2014-02-20 21:43:45 +00:00
Tobias Grosser d6aafa7c2e Do not track location of scalar dependences in ScopInfo
We do not have a use for this information at the moment. If we need this at some
point, the "instruction -> access" mapping needs to be enhanced as a single
instruction could then possibly perform multiple accesses.

This patch allows us to build the polyhedral information for scops with scalar
dependences.

llvm-svn: 201815
2014-02-20 21:29:09 +00:00
Tobias Grosser 612c2bc071 Fix typo
llvm-svn: 201814
2014-02-20 21:29:02 +00:00
Tobias Grosser 3b49fdb640 www: Add FOSDEM presentation and Polly buildbots
llvm-svn: 201720
2014-02-19 21:58:56 +00:00
Tobias Grosser a1689937ba Check scops a second time before working on them
In rare cases the modification of one scop can effect the validity of other
scops, as code generation of an earlier scop may make the scalar evolution
functions derived for later scops less precise. The example that triggered this
patch was a scop that contained an 'or' expression as follows:

  %add13710 = or i32 %j.19, 1
    -->  {(1 + (4 * %l)),+,2}<nsw><%for.body81>

Scev could only analyze the 'or' as it knew %j.19 is a multiple of 2. This
information was not available after the first scop was code generated (or
independent-blocks was run on it) and SCEV could not derive a precise SCEV
expression any more. This means we could not any more code generate this SCoP.
My current understanding is that there is always the risk that an earlier code
generation change invalidates later scops.  As the example we have seen here is
difficult to avoid, we use this occasion to guard us against all such
invalidations.

This patch "solves" this issue by verifying right before we start working on
a detected scop, if this scop is in fact still valid. This adds a certain
overhead. However the verification we run is anyways very fast and secondly
it is only run on detected scops. So the overhead should not be very large. As
a later optimization we could detect scops only on demand, such that we need
to run scop-detections always only a single time.

This should fix the single last failure in the LLVM test-suite for the new
scev-based code generation.

llvm-svn: 201593
2014-02-18 18:49:49 +00:00
Tobias Grosser 9b1100b305 Add ScopDetection::isValidRegion(Region)
llvm-svn: 201592
2014-02-18 18:49:46 +00:00
Tobias Grosser 5ea6b58e4a Fix formatting
llvm-svn: 201204
2014-02-12 01:55:28 +00:00
Tobias Grosser f07361d19a Add link to polyhedral.info
This website provides general information about polyhedral compilation.

llvm-svn: 201192
2014-02-11 23:34:43 +00:00
Tobias Grosser 86070d226b Remove MayAliasSet class
The MayAliasSet class is currently not used and just confuses people. We can
reintroduce it in case need a more precise tracking of alias sets.

llvm-svn: 201191
2014-02-11 23:34:40 +00:00
Tobias Grosser 933edd04af IndependentBlocks: Do not assert for PHI nodes outside of scops
There does not seem to be a reason that we can not support PHI nodes outside of
the scop that reference values within the SCoP. Or at least, the attached test
case seems to do the right thing. We remove the assert for now.

llvm-svn: 200427
2014-01-29 23:08:10 +00:00