Commit Graph

1458 Commits

Author SHA1 Message Date
Johannes Doerfert 909a3bf21d [Refactor] Use virtual and override appropriately
+ Add override for overwritten methods.
  + Remove virtual for methods we do not want to be overwritten.

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

llvm-svn: 230897
2015-03-01 18:40:25 +00:00
Johannes Doerfert 0200f2507e [Cleanup] Remove unused passes
llvm-svn: 230896
2015-03-01 18:38:35 +00:00
Johannes Doerfert 7b1b724c89 Update obsolete comment
llvm-svn: 230857
2015-02-28 17:10:06 +00:00
Johannes Doerfert d40991bf83 Format non-affine subregions news item
llvm-svn: 230852
2015-02-28 14:48:15 +00:00
Johannes Doerfert c28197e619 Add non-affine subregions to the news
llvm-svn: 230851
2015-02-28 14:46:26 +00:00
Johannes Doerfert 6982fa4bb0 [Fix] Two tests that broke during the last changes
llvm-svn: 230800
2015-02-27 21:58:26 +00:00
David Blaikie 47d6783913 Fix test I missed
This was & is failing at ToT, but now it's failing for the original
reason, not because the IR can't be parsed.

llvm-svn: 230797
2015-02-27 21:31:00 +00:00
David Blaikie c94eca0546 Update Polly tests to handle explicitly typed load changes in LLVM.
llvm-svn: 230796
2015-02-27 21:22:50 +00:00
David Blaikie d7b6aa3251 Update one test I missed when updating for the opaque pointer gep changes to LLVM.
llvm-svn: 230792
2015-02-27 20:43:19 +00:00
Johannes Doerfert 5079200510 Do some preparation even with scalar and phi modeling enabled
llvm-svn: 230790
2015-02-27 20:38:51 +00:00
David Blaikie bad3ff207f Update Polly tests to handle explicitly typed gep changes in LLVM
llvm-svn: 230784
2015-02-27 19:20:19 +00:00
Johannes Doerfert 514f6efa2b [FIX] Teach RegionGenerator to respect and update dominance
When we generate code for a whole region we have to respect dominance
  and update it too.
  The first is achieved with multiple "BBMap"s. Each copied block in the
  region gets its own map. It is initialized only with values mapped in
  the immediate dominator block, if this block is in the region and was
  therefor already copied. This way no values defined in a block that
  doesn't dominate the current one will be used.
  To update dominance information we check if the immediate dominator of
  the original block we want to copy is in the region. If so we set the
  immediate dominator of the current block to the copy of the immediate
  dominator of the original block.

llvm-svn: 230774
2015-02-27 18:29:04 +00:00
Johannes Doerfert 0b169c0cab Add verifier to the IslCodeGeneration
After a function was created we will verify it for Debug builds. If
  errors are found and debug-type equals "polly-codegen-isl" the SCoP,
  the isl AST, the function as well as the errors will be printed.

llvm-svn: 230767
2015-02-27 17:37:05 +00:00
Johannes Doerfert ecc33a1f67 Change argument "class" keyword to "const"
llvm-svn: 230666
2015-02-26 19:33:42 +00:00
Tobias Grosser 5e02c5f5b4 Update comment
Suggest-by: Johannes Doerfert
llvm-svn: 230642
2015-02-26 15:55:00 +00:00
Tobias Grosser f72bdbfbb1 Use isl_ast_expr_call to create run-time checks
isl recently introduced a new interface to create run-time checks from
constraint sets. Use this interface to simplify our run-time check generation.

llvm-svn: 230640
2015-02-26 15:21:10 +00:00
Tobias Grosser fa6cdc8a59 Update isl to 88d60cfe1 'add isl_ast_expr_call'
For Polly the two interesting changes are short_circuit && and || AST
expressions as well as the introduction of isl_ast_build_expr_from_set,
a well defined interface to compute ast expressions from constraint sets.

llvm-svn: 230636
2015-02-26 15:08:35 +00:00
Johannes Doerfert a36842f837 Allow non-affine control flow by default
With the patches r230325, r230329 and r230340 we can handle non-affine
  control flow in (loop-free) subregions. As all LLVM test-suite tests pass and
  we get ~20% more non-trivial SCoPs, we activate it now by default.

llvm-svn: 230624
2015-02-26 11:09:24 +00:00
Johannes Doerfert 1d8b9c1b1f Add the IMPACT2015 publications
It is important we add more publications with/about Polly so people
  can see that work and research is actually ongoing.

llvm-svn: 230552
2015-02-25 21:31:38 +00:00
Johannes Doerfert ae70ec88ae Add myself to the contributors of Polly
llvm-svn: 230546
2015-02-25 21:26:03 +00:00
Johannes Doerfert a8727861b5 Add non-affine subregions to the TODO list
llvm-svn: 230545
2015-02-25 21:20:57 +00:00
Tobias Grosser e395da7986 Update isl to 0980603 'isl_tab_pip.c: parallel_constraints: drop useless assignment'
This update contains:

  - Fixes of minor issues detected by clang's scan_build
  - More schedule tree infrastructure additions

This update slightly changes the output of our dependence analysis, but these
changes are purely syntactially.

llvm-svn: 230528
2015-02-25 19:34:52 +00:00
Tobias Grosser 6296d5ccfd Fix formatting
llvm-svn: 230504
2015-02-25 16:59:15 +00:00
Johannes Doerfert 275a1756ad Allow non-affine control flow -- Code Generation
This is the code generation for region statements that are created
  when non-affine control flow was present in the input. A new
  generator, similar to the block or vector generator, for regions is
  used to traverse and copy the region statement and to adjust the
  control flow inside the new region in the end.

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

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

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

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

llvm-svn: 230325
2015-02-24 11:45:21 +00:00
Johannes Doerfert f9e3462b69 [FIX] 2 broken tests
llvm-svn: 230231
2015-02-23 16:34:20 +00:00
Johannes Doerfert 4f8ac3d123 Use ScalarEvolution to create tight bounds on the parameters
llvm-svn: 230230
2015-02-23 16:15:51 +00:00
Johannes Doerfert fb79a96d42 [NFC] Unify the use of Context.CurRegion
llvm-svn: 230222
2015-02-23 14:18:28 +00:00
Johannes Doerfert b4f08eb671 [REFACTOR] Replace Pass* from BlockGen by the DomTree
llvm-svn: 230220
2015-02-23 13:51:35 +00:00
Johannes Doerfert ca08c44a46 Remove leftover code
llvm-svn: 230140
2015-02-21 16:18:28 +00:00
Tobias Grosser f567e1aab7 Fix formatting
llvm-svn: 229920
2015-02-19 22:16:12 +00:00
Johannes Doerfert 3f1c285294 [REFACTOR] Simplify the SCoP detection interface a bit
llvm-svn: 229879
2015-02-19 18:11:50 +00:00
Johannes Doerfert 3a7e812c66 [NFC] Generalize getIslCompatibleName interface.
llvm-svn: 229877
2015-02-19 18:09:39 +00:00
Tobias Grosser d4f232f03c Drop left over code from FinalRead statement removal.
We removed FinalRead statements in r152319.

llvm-svn: 229867
2015-02-19 16:24:57 +00:00
Tobias Grosser c56dcd52be Add missing comments to member variables
Reported-by: Johannes Doerfert
llvm-svn: 229854
2015-02-19 14:28:36 +00:00
Tobias Grosser d1e33e7061 ScopDetection: Only detect scops that have at least one read and one write
Scops that only read seem generally uninteresting and scops that only write are
most likely initializations where there is also little to optimize.  To not
waste compile time we bail early.

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

llvm-svn: 229820
2015-02-19 05:31:07 +00:00
Tobias Grosser 8c45037eb4 Add missing files to autoconf build
llvm-svn: 229479
2015-02-17 08:15:14 +00:00
Tobias Grosser af4535451f Update isl to 0ae2b02 "isl_seq_combine: optimize for common case"
This is just a single commit that includes a performance optimization that
should improve dependence analysis time. Our performance bots should measure
this difference.

llvm-svn: 229476
2015-02-17 07:39:25 +00:00
Tobias Grosser 1fa7b972c0 Update to isl 99d53692ba
This commit imports the latest isl version into lib/External/isl. The changes
relavant for Polly are:

  1) Schedule trees [1] have been introduced as a more structured way to
     describe schedules. Polly does not yet use them, but we may switch to them
     in the near future.
  2) Another set of coalescing changes [2] simplifies some data dependences and
     removes a couple of code generation artifacts.

     We now understand that the following sets can be merged:

     { Stmt_S1[i0, i1] -> Stmt_S2[i0 + i1] :
          i0 >= 0 and i1 <= 1023 - i0 and i1 >= 1
       Stmt_S1[i0, 0] -> Stmt_S2[i0] : i0 <= 1023 and i0 >= 1}

     into:

     { Stmt_S1[i0, i1] -> Stmt_S2[i0 + i1] : i1 <= 1023 - i0 and i1 >= 0 and
                                             i1 >= 1 - i0 and i0 >= 0 }

     Changes of this kind reduce unnecessary specialization during code
     generation.

     -  for (int c3 = 0; c3 <= 1023; c3 += 1) {
     -    if (c3 % 2 == 0) {
     -      Stmt_for_body3(c1, c3);
     -    } else
     -      Stmt_for_body3(c1, c3);
     -  }
     +  for (int c3 = 0; c3 <= 1023; c3 += 1)
     +    Stmt_for_body3(c1, c3);

[1] http://impact.gforge.inria.fr/impact2014/papers/impact2014-verdoolaege.pdf
[2] http://impact.gforge.inria.fr/impact2015/papers/impact2015-verdoolaege.pdf

llvm-svn: 229423
2015-02-16 19:33:40 +00:00
Tobias Grosser c3fe35df4c Fix formatting
llvm-svn: 229360
2015-02-16 06:40:23 +00:00
David Blaikie c4d7bc3fcc Update Polly for the removal of LLVM_DELETED_FUNCTION now that '= delete' works on all supported compilers (MSVC2012 compat has been dropped)
llvm-svn: 229344
2015-02-15 23:40:18 +00:00
Tobias Grosser 64a399a8c7 www: update installation instructions to not include gmp/isl
llvm-svn: 229305
2015-02-15 11:19:24 +00:00
Tobias Grosser 3588b74955 Remove isl/cloog build scripts
isl is not distributed as part of Polly.

llvm-svn: 229304
2015-02-15 11:19:20 +00:00
Tobias Grosser 503a6c1570 www: Add code coverage and scan-build results again
Sylvestre Ledru (re)enabled them after the import of isl into polly
significantly simplified the build.

llvm-svn: 229303
2015-02-15 10:41:06 +00:00
Johannes Doerfert 48d75034de Add getSize() to the SCoP class.
llvm-svn: 229254
2015-02-14 12:13:17 +00:00
Johannes Doerfert 6f7921f2be Do not try to optimize empty SCoPs.
llvm-svn: 229253
2015-02-14 12:02:24 +00:00
Johannes Doerfert b6755bbd5f Overaproximate divisions in for the alias checks.
Alias checks might become costly if there are divisions that complicate the
  description of the accessed locations. By overaproximating them we get fairly
  accurate results without the huge compile time cost.

llvm-svn: 229252
2015-02-14 12:00:06 +00:00
Chandler Carruth d01918fa13 [PM] Convert Polly over to directly use the legacy pass manager
namespace and header rather than the top-level header and using
declarations. These helpers impede modular builds and are going away.
Migrating away from them will also be necessary to start mixing in any
usage of the new pass manager.

llvm-svn: 229091
2015-02-13 09:51:50 +00:00
Tobias Grosser cf33c93bd4 Link LLVM libraries into libLLVMPolly if BUILD_SHARED_LIBS=ON is set
Without this change we get linker errors such as:

  undefined reference to `llvm::dbgs()'

We only conditionally link in these libraries, as in BUILD_SHARED_LIBS=OFF mode,
linking in these libraries causes such functions (and especially global options)
to be defined twice. The "solution" I choose is most likely not ideal, but seems
to work. If any cmake specialist can suggest a better approach, this would be
appreciated.

We also drop a .c file that is not needed as it caused linker errors as well.

llvm-svn: 228914
2015-02-12 08:27:19 +00:00
Johannes Doerfert 57ef179695 [FIX] Remove XFAIL again
llvm-svn: 228868
2015-02-11 19:28:39 +00:00
Johannes Doerfert c47edb51c6 [FIX] Correctly handle scalar dependences of branch instructions
llvm-svn: 228866
2015-02-11 19:12:19 +00:00
Johannes Doerfert d594aeb248 [FIX] Fix test case that was affected by the early exit patch
llvm-svn: 228865
2015-02-11 19:11:57 +00:00
Tobias Grosser a906ee754d Drop an assert and XFAIL two test cases
This gets the buildbot green to avoid further emails. Johannes will fix this
later in the evening.

llvm-svn: 228862
2015-02-11 18:46:33 +00:00
Johannes Doerfert 05c25c2679 Update TODO list.
llvm-svn: 228858
2015-02-11 18:18:19 +00:00
Johannes Doerfert 7ceb040213 Add early exits for SCoPs we did not optimize
This allows us to skip ast and code generation if we did not optimize
  a SCoP and will not generate parallel or alias annotations. The
  initial heuristic to exit is simple but allows improvements later on.

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

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

llvm-svn: 228851
2015-02-11 17:25:09 +00:00
Johannes Doerfert 1f87f485b1 Model scalar writes with uses outside the SCoP
These write are important as they will force the scheduling and code
  generation of an otherwise trivial statement and also impose an order of
  execution needed to guarantee the correct final value for a scalar in a loop.

  Added test case modeled after ClamAV/clamscan.

llvm-svn: 228847
2015-02-11 17:02:52 +00:00
Johannes Doerfert b9d18887d7 Allow signed devision in access functions
llvm-svn: 228833
2015-02-11 14:54:50 +00:00
Johannes Doerfert 97235c691a [FIX] Special case for branch users of scalar values
llvm-svn: 228832
2015-02-11 14:52:52 +00:00
Tobias Grosser bc8a5e2290 isl is now distributed with polly
llvm-svn: 228575
2015-02-09 13:52:21 +00:00
Johannes Doerfert 1ef52333c5 [Refactor] Use the LoopInfo object already present
llvm-svn: 228540
2015-02-08 20:50:42 +00:00
Johannes Doerfert be9c91173f [Refactor] Use only one BlockGenerator for a SCoP
This change has two main purposes:
    1) We do not use a static interface to hide an object we create and
       destroy for every basic block we copy.
    2) We allow the BlockGenerator to store information between calls to
       the copyBB method. This will ease scalar/phi code generation
       later on.

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

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

llvm-svn: 228443
2015-02-06 21:39:31 +00:00
Johannes Doerfert 4a60b173a7 Do not run independent blocks when we model all scalar dependences
llvm-svn: 228441
2015-02-06 21:26:45 +00:00
Johannes Doerfert 76e37fe005 [Fix] Broken test case
llvm-svn: 228439
2015-02-06 21:20:14 +00:00
Johannes Doerfert 0ff23ec544 Model PHI nodes without demoting them
This allows us to model PHI nodes in the polyhedral description
  without demoting them. The modeling however will result in the
  same accesses as the demotion would have introduced.

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

llvm-svn: 228433
2015-02-06 20:13:15 +00:00
Tobias Grosser f85d0e217f Build the isl files as PIC
Otherwise we get linker errors.

llvm-svn: 228204
2015-02-04 21:56:28 +00:00
Tobias Grosser 52a25237d8 Import isl(+imath) as an external library into Polly
With this patch Polly is always GPL-free (no dependency on GMP any more). As a
result, building and distributing Polly will be easier. Furthermore, there is no
need to tightly coordinate isl and Polly releases anymore.

We import isl b3e0fa7a05d as well as imath 4d707e5ef2. These are the git
versions Polly currently was tested with when using utils/checkout_isl.sh. The
imported libraries are both MIT-style licensed.

We build isl and imath with -fvisibility=hidden to avoid clashes in case other
projects (such as gcc) use conflicting versions of isl. The use of imath can
temporarily reduce compile-time performance of Polly. We will work on
performance tuning in tree.

Patches to isl should be contributed first to the main isl repository and can
then later be reimported to Polly.

This patch is also a prerequisite for the upcoming isl C++ interface.

llvm-svn: 228193
2015-02-04 20:55:43 +00:00
Tobias Grosser eb29c68df2 Add test case for r227805
llvm-svn: 227970
2015-02-03 15:11:02 +00:00
Johannes Doerfert a57746b871 [NFC] Fix typo
llvm-svn: 227955
2015-02-03 08:55:01 +00:00
Johannes Doerfert 4f33706b53 [NFC] Remove some unnecessary local objects
llvm-svn: 227844
2015-02-02 19:41:30 +00:00
Johannes Doerfert 535ee97853 [FIX] Updated test case (fixed names -> regular expressions)
llvm-svn: 227807
2015-02-02 16:13:36 +00:00
Johannes Doerfert 0837c2da74 [FIX] Partially fix the pointer negation crash
llvm-svn: 227805
2015-02-02 15:25:09 +00:00
Johannes Doerfert 8cd22d4947 [FIX] Check non-deterministic isl output
llvm-svn: 227802
2015-02-02 14:07:02 +00:00
Johannes Doerfert 9282076ece [NFC] Drop the "scattering" tuple name
llvm-svn: 227801
2015-02-02 13:45:54 +00:00
Tobias Grosser c897af3ffc Correct a typo in a comment
llvm-svn: 227569
2015-01-30 12:33:43 +00:00
Johannes Doerfert 3a3799e43a [FIX] Activated a pointer test and removed obsolete comment
llvm-svn: 227524
2015-01-30 00:36:13 +00:00
Johannes Doerfert cf0e05a58f [FIX] Correct two C snippets in test cases
llvm-svn: 227407
2015-01-29 00:50:46 +00:00
Johannes Doerfert ef61def9d5 [FIX] Handle pointer-pointer comparisons
This should fix a problem introduced by r225464.

llvm-svn: 227404
2015-01-29 00:41:33 +00:00
Johannes Doerfert 9e3a5db000 [FIX] Debug build + instrinsic handling
The ignored intrinsics needed to be ignored in three other places as
  well. Tests and lnt pass now.

llvm-svn: 227092
2015-01-26 15:55:54 +00:00
Johannes Doerfert 07e8a406d6 [FIX] Independent blocks with intrinsics handling
Also an old option was removed from some new test cases

llvm-svn: 227057
2015-01-25 19:09:49 +00:00
Johannes Doerfert 3f500fa2f6 Support for math/misc intrinsics
The support is currently limited as we only allow them in the input but do
  not emit them in the transformed SCoP due to the possible semantic changes.

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

llvm-svn: 227054
2015-01-25 18:07:30 +00:00
Tobias Grosser 7a08488ca6 Drop an unused parameter
llvm-svn: 226739
2015-01-21 23:11:46 +00:00
Duncan P. N. Exon Smith e566efec71 CodeGen: Update IRBuilder for LLVM API change
`MDNode::getTemporary()` returns a `unique_ptr<>` as of r226504.

llvm-svn: 226506
2015-01-19 21:31:48 +00:00
Chandler Carruth 62975f55c8 [PM] Update Polly for LLVM r226459 which removed another pass argument
from an API in the process of preparing for the new pass manager.

llvm-svn: 226460
2015-01-19 12:37:33 +00:00
Chandler Carruth 78ae1c92ca [multilib] Teach Polly's CMake to use the libdir suffix variable. This
lets 'ninja check-polly' pass for me with a lib64 build of LLVM.

I've not updated the standalone side as I don't use it and don't have an
easy way to test any changes I've made there. I mostly wanted to be able
to actually run Polly's tests when I update its use of LLVM's APIs
during my refactorings on the (very unlikely) off chance that I make
a change which compiles but does the wrong thing.

llvm-svn: 226420
2015-01-19 01:03:05 +00:00
Tobias Grosser a8cd15249a Remove redundant semicolon clang-format complained about
llvm-svn: 226402
2015-01-18 15:59:16 +00:00
Chandler Carruth 5ec3333d24 [PM] Update Polly for LLVM r226394 and r226396 which changed some of the
block splitting interfaces to accept specific analyses rather than
a pass.

llvm-svn: 226398
2015-01-18 10:52:23 +00:00
Chandler Carruth 6adcf56b0f [PM] Update Polly for LLVM r226385 which made LoopInfo actually derive
from LoopInfoBase<...>, removing the need for the awkward getBase()
dance.

llvm-svn: 226387
2015-01-18 01:47:30 +00:00
Chandler Carruth f557987b15 [PM] Update Polly following LLVM r226373 which refactors LoopInfo in
preparation for the new pass manager.

llvm-svn: 226374
2015-01-17 14:16:56 +00:00
Chandler Carruth be742b745b [PM] Track an LLVM API change by switching this code to directly create
the wrapper pass for TLI which is now separate from the core class.

llvm-svn: 226159
2015-01-15 10:43:18 +00:00
Tobias Grosser be30c2c56e Adjust to the new explicit debug metadata
This fixes the outfall of r226048

llvm-svn: 226134
2015-01-15 07:02:12 +00:00
Chandler Carruth d281ed5109 [PM] Update for LLVM r226078 which moved TargetLibraryInfo to the
Analysis library.

llvm-svn: 226080
2015-01-15 02:17:27 +00:00
Tobias Grosser c642e95402 Use types of matching size when generating multi-dimensional address expressions
This change ensures that the values that represent the array size of a
multi-dimensional access are correctly sign-extended when used to compute a
memory address used in the run-time alias check.

To make the test case more readable, we name the instructions that we generate.

llvm-svn: 225818
2015-01-13 19:37:59 +00:00
David Peixotto dc0a11c21f Fix maxLoopDepth computation in ScopInfo
The max loop depth was incorrectly computed for scops that contain a
block from a loop but do not contain the entire loop. We need to
check that the full loop is contained in the region when computing
the max loop depth.

These scops occur when a region containing an inner loop is expanded
to include some blocks from the outer loop, but it cannot be fully
expanded to contain the outer loop because the region containing the
outer loop is invalid.

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

llvm-svn: 225812
2015-01-13 18:31:55 +00:00
Tobias Grosser 2784b0803a Check assert before the instruction that uses the assumption checked.
I did not find a good test case, as the assert should generally hold in Polly.

llvm-svn: 225582
2015-01-10 07:40:39 +00:00
Tobias Grosser 0a092763e7 Adjust test for the new 'distinct' metadata nodes
'distinct' was introduced in 225474. We now adjust the test cases
to match for the additional 'distinct' marker.

llvm-svn: 225512
2015-01-09 08:10:36 +00:00
Tobias Grosser bfbc3690bb Add experimental support for unsigned expressions
This support is still incomplete and consequently hidden behind a switch that
needs to be enabled. One problem is ATM that we incorrectly interpret very large
unsigned values as negative values even if used in an unsigned comparision.

llvm-svn: 225480
2015-01-09 00:01:33 +00:00
Tobias Grosser 55bc4c0767 Add support for pointer types in expressions
llvm-svn: 225464
2015-01-08 19:26:53 +00:00
Tobias Grosser 021eaef044 Fix a crash in our error reporting
AF = dyn_cast<SCEVAddRecExpr>(Pair.second) may be NULL for some SCEVs that we do
not support. When reporting the error we still want to pass a pointer that is
known to always be non-NULL.

I do not yet have a test case for this, unfortunately.

llvm-svn: 225461
2015-01-08 19:03:10 +00:00
Tobias Grosser 37c93a9323 todo: Remove some redundant topics
llvm-svn: 225395
2015-01-07 21:28:44 +00:00
Tobias Grosser 1016991083 www: Make sure the main content pane does not overlap with the menu
llvm-svn: 225391
2015-01-07 21:21:55 +00:00
Tobias Grosser f7273badba todo: Adding native OpenSCoP support to Polly does not seem desirable
This would add another library dependency to Polly. In many cases the
JSCoP interface we have should be enough and an external JSCoP <> OpenSCoP
converter could be written. We can reconsider this if new use cases show up.

llvm-svn: 225390
2015-01-07 21:18:35 +00:00
Tobias Grosser 03e6476693 Add updated TODO list
llvm-svn: 225388
2015-01-07 21:16:33 +00:00
Tobias Grosser 314587d743 Use explicit StringRef Type
We previously used a Twine here, but as pointed out by David Blaikie
and Mehdi Amini storing a temporary StringRef in a Twine is not a good
idea, as the StringRef will be freed before the Twine is used leaving
a Twine that points to uninitialized memory. We now make it explicit that
we use a StringRef here.

llvm-svn: 225342
2015-01-07 07:43:34 +00:00
Tobias Grosser 5dfcb1a7e0 Do not use a const Twine here
This has caused segfaults when using Polly in the context of Julia, that are
not reproducible on my machine in 'make check-polly'.

llvm-svn: 225326
2015-01-07 00:30:01 +00:00
Tobias Grosser 80f6f11330 Make registerPollyPasses public
This function is needed for the integration of Polly into Julia.

llvm-svn: 225295
2015-01-06 20:40:33 +00:00
Tobias Grosser f8ae533f3d www: Draft changelog for the upcoming release.
llvm-svn: 225264
2015-01-06 12:57:44 +00:00
Tobias Grosser 6252bc8819 Fix html
llvm-svn: 225263
2015-01-06 12:31:31 +00:00
Tobias Grosser 67a8a7a94c We currently do not create these result for polly
We should reconsider this after having switched to imath (instead of gmp)
as the default isl backend, as this would allow us to keep a copy of isl
in the polly svn and to consequently make it easier to distribute Polly.

llvm-svn: 225262
2015-01-06 12:30:26 +00:00
Tobias Grosser 3f29619614 Drop all constant scheduling dimensions
Schedule dimensions that have the same constant value accross all statements do
not carry any information, but due to the increased dimensionality of the
schedule cost compile time. To not pay this cost, we remove constant dimensions
if possible.

llvm-svn: 225067
2015-01-01 23:01:11 +00:00
Andreas Simbuerger cd8500e500 (diagnostics) fix typo in test...
llvm-svn: 224591
2014-12-19 17:22:46 +00:00
Andreas Simbuerger 6492b700c3 (diagnostics) Fix typo.
Thanks Albert Cohen.

llvm-svn: 224584
2014-12-19 16:49:39 +00:00
Tobias Grosser 11e3873516 Dead code elimination: Update dependences after eliminating code
Without updating dependences we may lose implicit transitive dependences for
which all explicit dependences have gone through the statement iterations we
have just eliminated.

No test case. We should probably implement a -verify-dependences option.

This fixes llvm.org/PR21227

llvm-svn: 224459
2014-12-17 21:13:55 +00:00
Duncan P. N. Exon Smith 39e21f9c27 Hand-modify a testcase (still PR21532)
Bot was still tripping [1] on a testcase the upgrade script didn't
handle in 224269.  This is still fallout from r224257.

[1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25435

llvm-svn: 224280
2014-12-15 21:43:20 +00:00
Duncan P. N. Exon Smith bd62edb20d Run upgrade script from PR21532 to match LLVM changes
Update tests for LLVM assembly format change in r224257 using the script
attached to PR21532.  I'm hoping this unsticks the bot [1].

[1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25432

llvm-svn: 224269
2014-12-15 20:28:50 +00:00
Tobias Grosser 7b00d8f979 Do not run dead code elimination by default
The dead code elimination is a pass that looks very promising, but needs some
more compile-time tuning before enabling it by default seems sensible.

llvm-svn: 223965
2014-12-10 21:12:23 +00:00
Tobias Grosser bd8f3c1f61 Unbreak after LLVM's metadata split in r223802
llvm-svn: 223838
2014-12-09 22:02:16 +00:00
Tobias Grosser 05fdab9362 Simplify computation of reduction dependences
This simplifies the construction of the input for the reduction dependence
computation and at the same time removes an assumption that expects the schedule
to be of 2D + 1 form (the odd dimensions giving textual order, the even
dimensions the loop iterations).

llvm-svn: 223621
2014-12-07 22:51:45 +00:00
Duncan P. N. Exon Smith 16173b7f6c Stop relying on MDNode::get() returning self-references
Update for LLVM API change, wherein self-references are not uniqued (and
will never be returned by `MDNode::get()`).  We already have `Id`; just
return it.

This should fix the failing buildbot:

  http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25167
  http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25168

llvm-svn: 223620
2014-12-07 21:12:10 +00:00
Tobias Grosser e80523350f Drop unused 'docs' directory
llvm-svn: 223608
2014-12-07 16:04:33 +00:00
Tobias Grosser 13e222ca55 Update to the latest version of isl
Isl now specifically marks modulo operations that are compared against zero.
They can be implemented with the C/LLVM remainder operation.

We also update a couple of test cases where the output of isl has slightly
changed.

llvm-svn: 223607
2014-12-07 16:04:29 +00:00
Tobias Grosser 7ceaba8600 www-todo: No need to directly integrate with the basic block vectorizer
llvm-svn: 223606
2014-12-07 15:57:29 +00:00
Tobias Grosser a7e07abbff www-todo: We assume accesses to fixed-size arrays are in-bounds
llvm-svn: 223605
2014-12-07 15:56:21 +00:00
Tobias Grosser 4a69bea6c2 checkout_isl: Do not fail in presence of an old CLooG checkout
This should help our buildbots and may also simplify life for other people.

llvm-svn: 223152
2014-12-02 21:04:20 +00:00
Tobias Grosser e9458655fe Make checkout isl script executable
llvm-svn: 223146
2014-12-02 19:49:40 +00:00
Johannes Doerfert 305fed96e6 Drop Cloog support
This commit drops the Cloog support for Polly. The scripts and
  documentation are changed to only use isl as prerequisity. In the code
  all Cloog specific parts have been removed and all relevant tests have
  been ported to the isl backend when it was created.

llvm-svn: 223141
2014-12-02 19:26:58 +00:00
Tobias Grosser 7432a64dcb Drop unused enum value
llvm-svn: 222980
2014-11-30 15:57:07 +00:00
Tobias Grosser 71badac9d6 Remove Polly's IndVarSimplify pass
Polly had a copy of this pass to create the canonical induction variables
necessary for the non-scev-based code generation. As we now always use SCEV
based code generation, canonical induction variables are not needed any more.

llvm-svn: 222979
2014-11-30 14:33:41 +00:00
Tobias Grosser 683b8e4462 Remove -polly-codegen-scev option and related code
SCEV based code generation has been the default for two weeks after having
been tested for a long time. We now drop the support the non-scev-based code
generation.

llvm-svn: 222978
2014-11-30 14:33:31 +00:00
Tobias Grosser 65b2b03fa4 cmake: Add polly libraries to LLVMExports
This fixes LINK_POLLY_INTO_TOOLS=ON builds, which previously failed with:

CMake Error: install(EXPORT "LLVMExports" ...) includes target "opt" which
requires target "Polly" that is not in the export set.

CMake Error: install(EXPORT "LLVMExports" ...) includes target "bugpoint" which
requires target "Polly" that is not in the export set.

llvm-svn: 222977
2014-11-30 12:45:44 +00:00
Hongbin Zheng c5447f4c3b Do not incorrectly set the inverted flag.
In TempScopInfo::buildCondition we extract the conditions to guard the
BB *in addition of* loop bounds. This means we should only consider the
conditions in the paths (in CFG) that do not contain cycles (loops).

At the same time, we set the invert flag if the FalseBB of the current
branch dominates our target BB to indicate that we reach the target BB
with an inverted condition from the current branch.

In this case, the path from the FalseBB contains a cycle if the FalseBB
is the target of a backedge. The conditions implied by such a path should
not be consider. We can identify such a case by checking if the TrueBB
also dominates our target BB, which means we can also reach our target
BB from the TrueBB, without going through the backedge.

llvm-svn: 222907
2014-11-28 03:26:06 +00:00
Tobias Grosser 68c497fb22 autoconf: Move libraries later to ensure that all symbols are found
This fixes llvm.org/PR19540

llvm-svn: 222874
2014-11-27 10:14:27 +00:00
Tobias Grosser 154d9469f4 Add PreHeader always to OuterLoop
This fixes a bug introduce in r217525.

llvm-svn: 222766
2014-11-25 17:09:21 +00:00
Tobias Grosser 7b50beebe4 Assume GetElementPtr offsets to be inbounds
In case a GEP instruction references into a fixed size array e.g., an access
A[i][j] into an array A[100x100], LLVM-IR does not guarantee that the subscripts
always compute values that are within array bounds. We now derive the set of
parameter values for which all accesses are within bounds and add the assumption
that the scop is only every executed with this set of parameter values.

Example:

void foo(float A[][20], long n, long m {
    for (long i = 0; i < n; i++)
      for (long j = 0; j < m; j++)
        A[i][j] = ...

This loop yields out-of-bound accesses if m is at least 20 and at the same time
at least one iteration of the outer loop is executed. Hence, we assume:

  n <= 0 or m <= 20.

Doing so simplifies the dependence analysis problem, allows us to perform
more optimizations and generate better code.

TODO: The location where the GEP instruction is executed is not necessarily the
location where the memory is actually accessed. As a result scanning for GEP[s]
is imprecise. Even though this is not a correctness problem, this imprecision
may result in missed optimizations or non-optimal run-time checks.

In polybench where this mismatch between parametric loop bounds and fixed size
arrays is common, we see with this patch significant reductions in compile time
(up to 50%) and execution time (up to 70%). We see two significant compile time
regressions (fdtd-2d, jacobi-2d-imper), and one execution time regression
(trmm).  Both regressions arise due to additional optimizations that have been
enabled by this patch. They can be addressed in subsequent commits.

http://reviews.llvm.org/D6369

llvm-svn: 222754
2014-11-25 10:51:12 +00:00
Tobias Grosser 6a629c59ba Use isl_schedule_get_ctx
llvm-svn: 222560
2014-11-21 19:39:42 +00:00
Tobias Grosser 983997ff6a Fix typo
llvm-svn: 222559
2014-11-21 19:39:38 +00:00
Tobias Grosser b7e06becd9 todo: We can support modifiable memory access functions
llvm-svn: 222366
2014-11-19 16:31:33 +00:00
Tobias Grosser 5c9e79d025 todo: We now have OpenMP support in isl backend
llvm-svn: 222365
2014-11-19 16:30:16 +00:00
Johannes Doerfert cc652b88e8 Change states in the www/todo.html list
llvm-svn: 222362
2014-11-19 15:59:50 +00:00
Johannes Doerfert 9c14737b9b Simplify the SCEVAffinator [NFC]
llvm-svn: 222360
2014-11-19 15:36:59 +00:00
Tobias Grosser 422b30a017 Use new Small(Ptr)Set API
This fixes the recent build failures.

llvm-svn: 222358
2014-11-19 14:32:32 +00:00
Tobias Grosser 7031141009 Enable SCEV based code generation by default
SCEV based code generation allows Polly to detect and generate code for loops
that do not have an explicit induction variable, but only virtual induction
variables given by SCEV.

Being able to do so has two main benefits:

  - We can detect more scops by default
  - We require less canonicalization before Polly, which means we get closer
    to our goal of not touching the IR before analyzing its properties.
    Specifically, we do not need to run -polly-indvars to introduce explicit
    canonical induction variables.

This switch became possible as both the isl code generation and -polly-parallel
are LNT error free with SCEV based code generation and the isl ast generator.

llvm-svn: 222113
2014-11-16 22:50:23 +00:00
Tobias Grosser bab3568105 Modify test cases to work with SCEV based code generation
This patch includes tests where we actually need to adjust the CHECK lines
for SCEV based code generation. Besides these adjustments we add explicit
calls to -polly-codegen-scev=[true|false] and make sure we test both cases.

llvm-svn: 222112
2014-11-16 22:43:21 +00:00
Tobias Grosser 95cd1c718e Make usage of scev based code generation explicit in tests
This is in preparation of using SCEV based codegen by default in polly

llvm-svn: 222111
2014-11-16 21:43:28 +00:00