Commit Graph

1304 Commits

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