Commit Graph

779 Commits

Author SHA1 Message Date
Tobias Grosser 2ea6deb62f IslCodegen: Do not build upper bound in vector for
For for-nodes that are translated to a set of vector lanes, we already know the
overall number of iterations. Calculating the upper bound is consequently not
necessary. This change removes the code for upper bound calculation, which was
probably copy/pasted from the code generation for the normal for-loop.

This issue was found by Sylvestre's scan-build server.

llvm-svn: 193925
2013-11-02 12:59:39 +00:00
Tobias Grosser d764fcbd5a Update comments to address Sebastian's review
llvm-svn: 193741
2013-10-31 11:50:52 +00:00
Tobias Grosser e86109f508 ScopInfo: Add support for AssumedContext
When constructing a scop sometimes the exact representation of a statement or
condition would be very complex, but there is a common case which is a lot
simpler, but which is only valid under certain assumptions. The assumed context
records the assumptions taken during the construction of this scop and that need
to be code generated as a run-time test.

At the moment, we do not yet model any assumptions, but only added the
AssumedContext as well as the isl-ast generation support. As a next step,
this needs to be hooked up with the isl code generation.

if (1) /* run-time condition */
  {  /* optimized code */ }
else
  {  /* original code */ }

llvm-svn: 193652
2013-10-29 21:05:49 +00:00
Sylvestre Ledru 6a20b7e771 Fix a typo in my family name. Tobias: ;)
llvm-svn: 193603
2013-10-29 11:05:18 +00:00
Tobias Grosser ce4647227c www: Add information about upcoming Loop Optimization BoF
llvm-svn: 193468
2013-10-26 10:08:35 +00:00
Tobias Grosser 1bb2683589 www: Add information about isl-0.12.1 release
Polly can now be compiled without explicitly linking to GMP licensed code.

This patch also contains some formatting improvements.

llvm-svn: 193467
2013-10-26 10:01:52 +00:00
Tobias Grosser 8aa20901dc www: Add information about code coverage and static analysis
llvm-svn: 193466
2013-10-26 10:01:42 +00:00
Tobias Grosser dd6dc8276f clang-format: No empty line after 'public:'
llvm-svn: 192710
2013-10-15 14:41:02 +00:00
Tobias Grosser 4f8c0877e8 This test case requires assertions
llvm-svn: 192530
2013-10-12 09:15:56 +00:00
Tobias Grosser 49457d2767 Move to CLooG 0.18.1 and isl 0.12.1
llvm-svn: 192426
2013-10-11 07:38:50 +00:00
Sebastian Pop 20594a842c use -polly-codegen-isl in tests under test/Isl
llvm-svn: 192110
2013-10-07 16:43:04 +00:00
Sebastian Pop 946070f2f0 do not use -polly-cloog in a ScopInfo testcase
llvm-svn: 192109
2013-10-07 16:43:00 +00:00
Sebastian Pop 40408760c1 do not compute isl_map_dim in the loop
llvm-svn: 191969
2013-10-04 17:14:53 +00:00
Tobias Grosser 0d17013cb7 clang-format
llvm-svn: 191895
2013-10-03 13:09:19 +00:00
Tobias Grosser 51b78752fe Use LLVM_DELETED_FUNCTION instead of a comment
Contributed-by:  Michael Kruse  <MichaelKruse@meinersbur.de>
llvm-svn: 191894
2013-10-03 13:09:14 +00:00
Tobias Grosser 1ff0be799d ScopInfo: Do not include "isl/int.h" any more
We already removed all uses of isl_int in ScopInfo.

Contributed-by:  Michael Kruse  <MichaelKruse@meinersbur.de>
llvm-svn: 191893
2013-10-03 13:09:07 +00:00
Tobias Grosser abe9193b6b ScopInfo: Fix typos
Contributed-by:  Michael Kruse  <MichaelKruse@meinersbur.de>
llvm-svn: 191892
2013-10-03 13:08:59 +00:00
Tobias Grosser b276158efa clang-format recent change
llvm-svn: 190842
2013-09-17 03:30:36 +00:00
Tobias Grosser 0695ee433e Move SCEVAffinator member definitions out of class body
Instead of defining the relevant functions inline, we now just keep the
declarations in the class itself. This makes the class declaration a lot
easier to read as all functions can be seen at once. We also use this
opportunity to privatize all functions not used in the public interface of the
class.

llvm-svn: 190841
2013-09-17 03:30:31 +00:00
Matt Arsenault 77d55f8abd Fix build after SCEV change
llvm-svn: 190429
2013-09-10 20:22:17 +00:00
Tobias Grosser e2622c2acc TempScopInfo: Microoptimize constant conditions
Use 0 >= 1 instead of 0 != 0 to represent 'false'. This might be slightly more
efficient as isl may create a union of sets for 0 != 0, whereas this is never
needed for the expression 0 >= 1.

Contributed-by: Alexandre Isoard <alexandre.isoard@gmail.com>
llvm-svn: 190384
2013-09-10 04:47:19 +00:00
Tobias Grosser 3613fd7a35 ScopInfo: Correctly handle true/false conditions
This is a modified version of the orignally contributed patch.

Contributed-by: alexandre.isoard@gmail.com
llvm-svn: 190237
2013-09-07 01:54:13 +00:00
Tobias Grosser 815c635cec [CodeGen] Fixup assert fails caused by incorrect LoopInfo update
Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 189764
2013-09-02 16:13:00 +00:00
Tobias Grosser 4c932b8a4b Remove unneeded comma and update formatting
llvm-svn: 189177
2013-08-24 17:58:59 +00:00
Logan Chien f166ea6715 Rename "polly-test" in the document and script.
The Makefile rule "polly-test" has been renamed to
"check-polly" in r182171.  This CL updates the document and
the automatic build script.

llvm-svn: 188624
2013-08-18 07:33:28 +00:00
Daniel Dunbar 2bd59a2cc7 [tests] Update to use lit_config and lit package, as appropriate.
llvm-svn: 188114
2013-08-09 21:54:36 +00:00
Tobias Grosser e2c05bbefe PollyDependence: Simplify Read/Write/MayWrite before feeding them into ISL.
Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 187981
2013-08-08 13:55:45 +00:00
Tobias Grosser 22a155a7a6 ScopInfo: add a testcase that share parameters within nested start.
Contributed-by:  Star Tan <tanmx_star@yeah.net>
llvm-svn: 187772
2013-08-06 04:36:45 +00:00
Tobias Grosser e42ddb9ad3 ScopInfo: Split start value from SCEVAddRecExpr to enable parameter sharing.
SCoP invariant parameters with the different start value would deter parameter
sharing. For example, when compiling the following C code:

  void foo(float *input) {
    for (long j = 0; j < 8; j++) {
      // SCoP begin
      for (long i = 0; i < 8; i++) {
        float x = input[j * 64 + i + 1];
        input[j * 64 + i] = x * x;
      }
    }
  }

Polly would creat two parameters for these memory accesses:

    p_0: {0,+,256}
    p_2: {4,+,256}
    [j * 64 + i + 1] => MemRef_input[o0] : 4o0 = p_1 + 4i0
    [j * 64 + i]     => MemRef_input[o0] : 4o0 = p_0 + 4i0

These parameters only differ from start value. To enable parameter sharing,
we split the start value from SCEVAddRecExpr, so they would share a single
parameter that always has zero start value:

    p0: {0,+,256}<%for.cond1.preheader>
    [j * 64 + i + 1] => MemRef_input[o0] : 4o0 = 4 + p_1 + 4i0
    [j * 64 + i]     => MemRef_input[o0] : 4o0 = p_0 + 4i0

Such translation can make the polly-dependence much faster.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 187728
2013-08-05 15:14:15 +00:00
Tobias Grosser abd96a0c0a Dependence: Add DEBUG support.
Contributed-by:  Star Tan <tanmx_star@yeah.net>
llvm-svn: 187498
2013-07-31 14:35:17 +00:00
Tobias Grosser 96ef078583 Remove '-debug-only' from test case
This flags was not used in the test case, but caused failures when LLVM was
built without debugging. We can savely remove it.

llvm-svn: 187343
2013-07-29 05:35:11 +00:00
Tobias Grosser 6e358c067a TempScop: Actually load Polly in this test case
llvm-svn: 187342
2013-07-29 05:18:09 +00:00
Tobias Grosser 7032ea6f5b Remove second '-analyze' from command line
llvm-svn: 187341
2013-07-29 05:15:33 +00:00
Tobias Grosser 85f7421731 JSONImporter: Free new schedule if found invalid
In case we detect that the schedule the user wants to import is invalid we
refuse it _and_ free the isl_maps containing it.

Another bug found thanks to Rafael.

llvm-svn: 187339
2013-07-29 05:12:01 +00:00
Tobias Grosser 880c52f56a CodeGeneration: Fix double free in vector for
We now use __isl_take to annotate the uses of the isl_set where we got the
memory management wrong.

Thanks to Rafael! His pipefail work hardened our test environment and exposed
this bug nicely.

llvm-svn: 187338
2013-07-29 01:58:07 +00:00
Rafael Espindola cd61afb4ee Use a slightly smaller hammer to make this pass.
When first updating this test I only noticided the first RUN line.

llvm-svn: 187328
2013-07-28 11:13:49 +00:00
Tobias Grosser 983e785f17 gitattributes: .png and .txt are no text files
llvm-svn: 187326
2013-07-28 09:05:20 +00:00
Tobias Grosser 25f0342a68 Temporary disable a test until I finished the fix
llvm-svn: 187305
2013-07-27 15:19:57 +00:00
Rafael Espindola 0329bb4fce Looks like this test crashes. Add --crash to not for now.
llvm-svn: 187300
2013-07-27 11:08:44 +00:00
Rafael Espindola e559af8205 Add not to commands that fail.
Polly devs: please check if these commands really should fail.

llvm-svn: 187263
2013-07-26 22:49:25 +00:00
Hongbin Zheng 5b463ceaf5 BlockGenerator: Split getNewValue.
Split the old getNewValue into two parts:

1. The function "lookupAvailableValue" that return the new version of
the instruction which is already available.

2. The function calls "lookupAvailableValue", and tries to generate
the new version if it is not available yet.

llvm-svn: 187114
2013-07-25 09:12:07 +00:00
Tobias Grosser c7d3fc5547 ScopDetect: Only track detection failures if actually needed.
String operations resulted by raw_string_ostream in the INVALID macro can lead
to significant compile-time overhead when compiling large size source code.
This is because raw_string_ostream relies on TypeFinder class, whose
compile-time cost increases as the size of the module increases. This patch
targets to ensure that it only track detection failures if actually needed.
In this way, we can avoid expensive string operations in normal execution.

With this patch file, the relative compile-time cost of Polly-detect pass does
not increase even when compiling very large size source code.

Contributed-by:   Star Tan <tanmx_star@yeah.net>
llvm-svn: 187102
2013-07-25 03:02:29 +00:00
Tobias Grosser 8002201fd6 Convert line endings to unix style
llvm-svn: 187101
2013-07-25 03:02:26 +00:00
Tobias Grosser 6bcb34b180 ScopDetect: Add some test cases for sequential loops
llvm-svn: 187024
2013-07-24 06:10:37 +00:00
Tobias Grosser ff9bfdfa80 ScopInfo/IndependentBlocks: clang-format
llvm-svn: 187023
2013-07-24 06:10:30 +00:00
Tobias Grosser 54cb789d39 RegisterPass: Unhide -polly-show and -polly-show-only
llvm-svn: 186806
2013-07-22 04:11:00 +00:00
Tobias Grosser 5b1a7f2245 ScopDetect: move "return false" out of INVALID macro.
Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 186805
2013-07-22 03:50:33 +00:00
Hongbin Zheng 63cc9467af Ensure a correct order between memory accesses.
Ensure that the scalar write access corresponds to the result of a load
instruction appears after the generic read access corresponds to the load
instruction.

llvm-svn: 186419
2013-07-16 15:20:29 +00:00
Hongbin Zheng 5a772dcd84 IndependentBlock: Add option to disable scalar to array rewriting.
llvm-svn: 186418
2013-07-16 15:19:33 +00:00
Hongbin Zheng c6aa9f5c2a Make sure the each instruction is mapped to one memory access.
llvm-svn: 186417
2013-07-16 15:18:51 +00:00