Commit Graph

904 Commits

Author SHA1 Message Date
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