Commit Graph

1048 Commits

Author SHA1 Message Date
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
Tobias Grosser 28a70c543d ScopDetect: Transitively remove all children after region expansion
In rare cases, a region R which is itself not valid has an indirect child region
that is valid. When R becomes part of a valid region by expansion of another
region, then all children of R have to be erased from the set of valid regions.
This patch ensures that indirect children are erased in addition to direct
children.

Contributed-by: Armin Groesslinger <armin.groesslinger@uni-passau.de>

Tobias: I added a reduced test case and adjusted the logic of the patch to
        only recurse until the first child is found.
llvm-svn: 200411
2014-01-29 19:05:30 +00:00
Tobias Grosser e200d58ad7 Add missing doxygen comment
llvm-svn: 200410
2014-01-29 19:05:22 +00:00
Tobias Grosser ab2227a505 Do not verify the base addresses
Verification of base addresses is difficult as the independent blocks pass may
introduce aliasing that was not there during scop detection. As a midterm
solution -polly-codegen-scev will remove the need for the independent blocks
pass. For now, we do not verify at compile time that the independent blocks pass
does not make the base addresses loop invariant. Disabling this just removes
one of the multiple safety layers we have. We still can check for correctness
in our regression tests.

llvm-svn: 200315
2014-01-28 13:43:24 +00:00
Tobias Grosser 458fb78cfa Check if array base addresses are invariant
Array base addresses need to be invariant in the region considered. The base
address has to be computed outside the region, or, when it is computed inside,
the value must not change with the iterations of the loops. For example, when a
two-dimensional array is represented as a pointer to pointers the base address
A[i] in an access A[i][j] changes with i; therefore, such regions have to be
rejected.

Contributed by:  Armin Größlinger <armin.groesslinger@uni-passau.de>

llvm-svn: 200314
2014-01-28 12:58:58 +00:00
Tobias Grosser 5b5daab9f1 Add more test cases to check loop invariance of the base pointer.
llvm-svn: 200305
2014-01-28 10:29:17 +00:00
Tobias Grosser 6a62ebdd0f TODO: Add topic 'teach bugpoint to extract regions'
This does not only seem helpful for Polly, but it should help in general to
further reduce bugs.

llvm-svn: 200225
2014-01-27 14:48:17 +00:00
Tobias Grosser 4449e52655 Detection: Allow to filter the regions that can be detected
llvm-svn: 200224
2014-01-27 14:24:53 +00:00
Tobias Grosser 5ff8579ced Remove an unused parameter
llvm-svn: 200209
2014-01-27 10:44:25 +00:00
Tobias Grosser f20210940c Allow Polly at all optimization levels
Restricting Polly to -O3 does not make a lot of sense as it is opt-in anyway
and users who specifically request it should get it. If this causes performance
problems we should rather address them by scheduling the right cleanup passes
then just prevent the user from trying.

Also restricting Polly to -O3 made bugpoint not work with the -O3 flag and polly
enabled.

llvm-svn: 200208
2014-01-27 10:44:21 +00:00
Tobias Grosser 24d7e669b3 Do not test polybench with 'make check-polly'
Those test cases should be tested in the LLVM test suite. For Polly we should
extract regression tests for the individual passes.

llvm-svn: 200206
2014-01-27 10:37:33 +00:00
Tobias Grosser 54646f7fab Remove other unneccessary uses of -O3 in the test suite
The polly test suite is now -O3 clean.

llvm-svn: 200205
2014-01-27 10:37:06 +00:00
Tobias Grosser a7fea8386c Do not run -O3 to canonicalize test case
This is not only not necessary, but in case -03 changes this can actually
cause arbitrarily failing test cases such as, e.g., a recent change by Chandler
that caused -O3 to unroll the loop body, which made the loop we wanted to
detect disappear and consequently this test case fail.

llvm-svn: 200204
2014-01-27 10:23:12 +00:00
Tobias Grosser b917f47fc4 Dependences: Bound the time dependence calculation is allowed to take
Count the number of computational steps that have been used to solve the
dependence problem and abort in case we reach the "compute-out". This ensures we
do not hang forever in cases the dependence problem is too difficult to solve.
There is just a single case in the LLVM test-suite that runs into the
compute-out. Even in this case, we can probably coalesce some of the parameters
(i32 b, i32 b zext i64, ...) to simplify the problem enough to not hit the
compute out. However, for now we set the compute out in place to address the
general issue. The compute out was choosen such that it stops on a recent laptop
after about 8 seconds.

llvm-svn: 200156
2014-01-26 19:38:34 +00:00
Tobias Grosser a38c92406c Update to isl 1b3ba3b72c0482fd36bf0b4a1186a259f7bafeed
This includes the following very useful isl commit:

commit d962967ab42323ea5ca0398956fbff6a98c782fa
Author: Sven Verdoolaege <skimo@kotnet.org>
Date:   Wed Dec 18 12:05:32 2013 +0100

allow the user to impose a bound on the number of low-level operations

This should allow the user to deterministically limit the effort spent on a
computation.

llvm-svn: 200155
2014-01-26 19:36:28 +00:00
Tobias Grosser 0d43646f93 Adjust test case to changed cloog output
llvm-svn: 199587
2014-01-19 11:53:51 +00:00
Tobias Grosser 26338283d8 Switch isl back to isl 0.12.1
The newer isl version broke backward compatibility. For some reason, I did not
find this in my own tests.

llvm-svn: 199586
2014-01-19 11:53:18 +00:00
Tobias Grosser b8cd4a8341 CodeGeneration: Replace reference to isl_int with explicit mpz call.
This removes the last isl_int dependency in the default build. There are
still some in OpenScop and Scoplib. For those isl-0.12.2 still needs to be used.

llvm-svn: 199585
2014-01-19 11:31:23 +00:00
Tobias Grosser e956194ce7 Update to the latest cloog and isl versions
This brings in isl_val support from cloog and, most importantly the following
isl commit:

commit d962967ab42323ea5ca0398956fbff6a98c782fa
Author: Sven Verdoolaege <skimo@kotnet.org>
Date:   Wed Dec 18 12:05:32 2013 +0100

    allow the user to impose a bound on the number of low-level operations

    This should allow the user to deterministically limit the effort spent on a
    computation.

llvm-svn: 199582
2014-01-19 11:03:27 +00:00
Sylvestre Ledru 660712570a llvm/IR/Writer.h has been removed in llvm commit r198836 and seems useless in polly
llvm-svn: 199360
2014-01-16 07:10:09 +00:00
Tobias Grosser 42aff30dbc Adapt to DomTree changes in r199104
llvm-svn: 199157
2014-01-13 22:29:56 +00:00
Chandler Carruth e87c6a81d6 [cleanup] Update Polly for moved header in LLVM r199082.
llvm-svn: 199088
2014-01-13 09:56:11 +00:00
Tobias Grosser f240b487a3 Remove IR/Writer.h
This should fix the buildbots.

llvm-svn: 198859
2014-01-09 10:42:15 +00:00
Chandler Carruth e243b03a8c Update #include paths for r198688 in LLVM that moved headers in the Assembly
directory to their proper homes.

llvm-svn: 198691
2014-01-07 12:59:58 +00:00
Tobias Grosser 20b9966e5f www: Fix typo II
llvm-svn: 198596
2014-01-06 09:53:00 +00:00
Tobias Grosser 2cc9463abe www: Fix typo
llvm-svn: 198595
2014-01-06 09:52:42 +00:00
Tobias Grosser d4521051bf www: Add link to newly released islplot library
llvm-svn: 198594
2014-01-06 09:51:38 +00:00
Tobias Grosser 63c6b45a5a Temporarily reformat Polly to silence buildbots
We may revert this depending on how the current discussion on llvm-commits
ends.

llvm-svn: 198581
2014-01-06 01:37:13 +00:00
Tobias Grosser ca7887d729 Another formatting fix
llvm-svn: 198386
2014-01-03 00:56:20 +00:00
Tobias Grosser 765a70abab Fix formatting issues
llvm-svn: 198384
2014-01-03 00:44:43 +00:00
Tobias Grosser a9376ff571 Introduce -polly-canonicalize pass
This ModulePass schedules the set of Polly canonicalization passes. It is a
debugging tool that can be used to preoptimize .ll files for Polly processing.

llvm-svn: 198376
2014-01-02 23:39:18 +00:00
Tobias Grosser e61b86c9cd RegisterPasses: Do not claim we schedule canonicalization passes at -O0
Also the code makes the impression this was happening, shouldEnablePolly()
always returns false for optlevel equal to zero. This was previously different,
but was accidentally changed by a commit a couple of months ago. As this
behavior was mainly a debugging tool and adding this to clang never really made
sense, we just remove the last traces.

llvm-svn: 198370
2014-01-02 22:48:50 +00:00
Tobias Grosser 9a26f2986c ScopInfo: Ensure the RegionInfo analysis is always available
This fixes a crash that appeared when generating dotty graphs for functions
without loops (for which we do not calculate polyhedral information).

llvm-svn: 198364
2014-01-02 22:28:53 +00:00
NAKAMURA Takumi d40d387fb1 Update the copyright credits -- Happy new year 2014!
FIXME: Dragonegg may be updated at non-trivial changes.
llvm-svn: 198274
2014-01-01 08:27:31 +00:00
Tobias Grosser 2658ea9e90 www: Simplify css
llvm-svn: 197847
2013-12-21 00:26:05 +00:00
Tobias Grosser 556416dab8 www: Fix typos
Reported-by: Dmitry N. Mikushin <maemarcus@gmail.com>
llvm-svn: 197796
2013-12-20 09:49:24 +00:00
Tobias Grosser eb145bb449 www: Do not use a fixed with, but use max-width
Further:

  o ensure that the header is properly readable even on smaller screen sizes.
  o Shorten the table of contents of the documentation section.

llvm-svn: 197794
2013-12-20 09:24:34 +00:00
Tobias Grosser b2ecb3c8f5 www: Do not use a small fonts for the core text
llvm-svn: 197793
2013-12-20 09:24:28 +00:00
Tobias Grosser 837c4d0ace www: Name the tiling scheme in the header
llvm-svn: 197763
2013-12-20 01:18:58 +00:00
Tobias Grosser 7110f332eb www: No need to mention Polly in each subtitle
llvm-svn: 197760
2013-12-20 00:53:01 +00:00
Tobias Grosser 1d67bbb96b www: Highlight title, add subtitle
llvm-svn: 197752
2013-12-19 23:44:07 +00:00
Tobias Grosser bd5262349d www: Mark more items done
llvm-svn: 197747
2013-12-19 23:23:44 +00:00
Tobias Grosser 1b7f94161d www: We already integrated the isl code generator
llvm-svn: 197746
2013-12-19 23:22:28 +00:00
Tobias Grosser b3bf54e812 www: Use red for visited links
llvm-svn: 197745
2013-12-19 23:22:25 +00:00
Tobias Grosser 0f6108269d www: Add favicon
llvm-svn: 197739
2013-12-19 22:59:47 +00:00
Tobias Grosser ca4ca288d3 www: Add nice header
llvm-svn: 197738
2013-12-19 22:50:10 +00:00
Tobias Grosser 5c6c62f7fc www: shorten menu entry
llvm-svn: 197724
2013-12-19 21:26:44 +00:00
Tobias Grosser 3905cb3d70 www: Rename menu items
llvm-svn: 197723
2013-12-19 21:25:48 +00:00
Tobias Grosser fcb4874454 www: Use a modern menu style
llvm-svn: 197722
2013-12-19 21:22:24 +00:00