Commit Graph

886 Commits

Author SHA1 Message Date
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 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
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 c47edb51c6 [FIX] Correctly handle scalar dependences of branch instructions
llvm-svn: 228866
2015-02-11 19:12:19 +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 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
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 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 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
Johannes Doerfert 4f33706b53 [NFC] Remove some unnecessary local objects
llvm-svn: 227844
2015-02-02 19:41:30 +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 9282076ece [NFC] Drop the "scattering" tuple name
llvm-svn: 227801
2015-02-02 13:45:54 +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 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
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
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 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 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