Commit Graph

62 Commits

Author SHA1 Message Date
Michael Kruse 9cc1b9d31e Clean-up unit tests
Remove redundant flags and duplicate invocations of the same test.

llvm-svn: 247285
2015-09-10 14:42:09 +00:00
Chandler Carruth 66ef16b289 [PM] Update Polly for the new AA infrastructure landed in r247167.
llvm-svn: 247198
2015-09-09 22:13:56 +00:00
Johannes Doerfert 717b866798 Allow PHI nodes in the region exit block
While we do not need to model PHI nodes in the region exit (as it is not part
  of the SCoP), we need to prepare for the case that the exit block is split in
  code generation to create a single exiting block. If this will happen, hence
  if the region did not have a single exiting block before, we will model the
  operands of the PHI nodes as escaping scalars in the SCoP.

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

llvm-svn: 247078
2015-09-08 21:44:27 +00:00
Tobias Grosser 02e6589bda Move more compile-time bailouts into -polly-detect-unprofitable
Instead of having two separate options
-polly-detect-scops-in-functions-without-loops and
-polly-detect-scops-in-regions-without-loops we now just use
-polly-detect-unprofitable to force the detection of scops ignoring any compile
time saving bailout heuristics.

llvm-svn: 247057
2015-09-08 19:46:41 +00:00
Tobias Grosser 40820ca286 Fix another typo in the subloop counting
... as well as the corresponding test cases.

Thank's Johannes for finding this bug.

llvm-svn: 246483
2015-08-31 21:04:51 +00:00
Tobias Grosser 050e0cbc0e ScopDetection: Correctly count the loops in a region
There is no reason the loops in a region need to touch either entry or exit
block. Hence, we need to look through all loops that may touch the region as
well as their children to understand if our region has at least two loops.

llvm-svn: 246433
2015-08-31 12:08:11 +00:00
Duncan P. N. Exon Smith adbcf12029 DI: Fix testcases after LLVM r246327
I ran the script from r246327 and it touched all the right files;
committing now to hopefully right the bots, but if my check-polly
doesn't come back clean I'll keep looking.

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

llvm-svn: 246341
2015-08-28 22:01:49 +00:00
Tobias Grosser ed21a1fc7e Do not detect Scops with only one loop.
If a region does not have more than one loop, we do not identify it as
a Scop in ScopDetection. The main optimizations Polly is currently performing
(tiling, preparation for outer-loop vectorization and loop fusion) are unlikely
to have a positive impact on individual loops. In some cases, Polly's run-time
alias checks or conditional hoisting may still have a positive impact, but those
are mostly enabling transformations which LLVM already performs for individual
loops. As we do not focus on individual loops, we leave them untouched to not
introduce compile time regressions and execution time noise. This results in
good compile time reduction (oourafft: -73.99%, smg2000: -56.25%).

Contributed-by: Pratik Bhatu <cs12b1010@iith.ac.in>

Reviewers: grosser

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

llvm-svn: 246161
2015-08-27 16:55:18 +00:00
Michael Kruse d568a3e20d Update test case multidim_indirect_access.ll
This test was written to check the workings of IndependentBlocks on
arrays which doesn't do such transformations anymore. The test itself
is still useful to check that the region is rejected as SCoP.  

llvm-svn: 245353
2015-08-18 21:08:41 +00:00
Michael Kruse 4adb0279a8 Add test case with PHI node in exit block
The PHI node with multiple incoming edges from inside the region.

Thanks Tobias for coming up with the example. 

llvm-svn: 244456
2015-08-10 16:17:59 +00:00
Duncan P. N. Exon Smith 20b50f2b2a Update testcases after LLVM r243885
llvm-svn: 243887
2015-08-03 17:28:43 +00:00
Tobias Grosser 80e237bd53 Do not detect scops that are delinearized to arrays with "undef" size
Such codes are not interesting to optimize and most likely never appear in the
normal compilation flow. However, they show up during test case reduction with
bugpoint and trigger -- without this change -- an assert in
polly::MemoryAccess::foldAccess(). It is better to detect them in
ScopDetection itself and just bail out.

Contributed-by:  Utpal Bora  <cs14mtech11017@iith.ac.in>

Reviewers: grosser

Subscribers: pollydev, llvm-commits

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

llvm-svn: 243515
2015-07-29 13:52:05 +00:00
Tobias Grosser af4e809ca6 Remove code for scalar and PHI to array translation
This removes old code that has been disabled since several weeks and was hidden
behind the flags -disable-polly-intra-scop-scalar-to-array=false and
-polly-model-phi-nodes=false. Earlier, Polly used to translate scalars and
PHI nodes to single element arrays, as this avoided the need for their special
handling in Polly. With Johannes' patches adding native support for such scalar
references to Polly, this code is not needed any more. After this commit both
-polly-prepare and -polly-independent are now mostly no-ops. Only a couple of
simple transformations still remain, but they are scheduled for removal too.

Thanks again to Johannes Doerfert for his nice work in making all this code
obsolete.

llvm-svn: 240766
2015-06-26 07:31:18 +00:00
Tobias Grosser 50165ffdee Add support for srem instruction
Remainder operations with constant divisor can be modeled as quasi-affine
expression. This patch adds support for detecting and modeling them. We also
add a test that ensures they are correctly code generated.

This patch was extracted from a larger patch contributed by Johannes Doerfert
in http://reviews.llvm.org/D5293

llvm-svn: 240518
2015-06-24 04:13:29 +00:00
Tobias Grosser 8199c722c7 Disable output for test case that does not need output
llvm-svn: 239060
2015-06-04 17:59:51 +00:00
Tobias Grosser 268205939f Make use of scalar/phi code generation explicit in the tests
This ensures we pass all tests independently of how we set the options
-disable-polly-intra-scop-scalar-to-array and -polly-model-phi-nodes.

(At least if we enable both or disable both. Enabling them individually makes
 little sense, as they will hopefully disappear soon anyhow).

llvm-svn: 238087
2015-05-23 03:34:35 +00:00
Tobias Grosser 09d3069740 Rename IslCodeGeneration to CodeGeneration
Besides class, function and file names, we also change the command line option
from -polly-codegen-isl to just -polly-codegen. The isl postfix is a leftover
from the times when we still had the CLooG based -polly-codegen. Today it is
just redundant and we drop it.

llvm-svn: 237099
2015-05-12 07:45:52 +00:00
Johannes Doerfert 8983031b5e [FIX] Invalid recognition of multidimensional access
In the lnt benchmark MultiSource/Benchmarks/MallocBench/gs/gs with
  scalar and PHI modeling we detected the multidimensional accesses
  with sizes variant in the SCoP. This will check the sizes for validity.

llvm-svn: 236395
2015-05-03 16:03:01 +00:00
Duncan P. N. Exon Smith ddf3a0ef38 Update polly for LLVM rename of debug info metadata with DI* prefix
Ran the same rename-md-di-prefix.sh script attached to PR23080 as in
LLVM r236120 and CFE r236121.

llvm-svn: 236127
2015-04-29 17:02:14 +00:00
Tobias Grosser 173ecab705 Remove target triples from test cases
I just learned that target triples prevent test cases to be run on other
architectures. Polly test cases are until now sufficiently target independent
to not require any target triples. Hence, we drop them.

llvm-svn: 235384
2015-04-21 14:28:02 +00:00
Johannes Doerfert f8206cf6d4 Allow loops in non-affine subregions -- SCoP Modeling
This will allow the ScopInfo to build the polyhedral representation for
  non-affine regions that contain loops. Such loops are basically not visible
  in the SCoP representation. Accesses that are variant in such loops are
  therefor represented as non-affine accesses.

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

llvm-svn: 234713
2015-04-12 22:58:40 +00:00
Tobias Grosser 2a586c387b Do not assume all multi-parameter products are affine
As soon as one operand of the product is invalid, the entire product is invalid.
This happens for example if one of the operands is not loop-invariant.

This fixes http://llvm.org/PR23125

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com
llvm-svn: 234119
2015-04-05 14:57:50 +00:00
Duncan P. N. Exon Smith 0353f279f1 Fix debug info now that the verifier is on
`i32 0` isn't a valid type, and `!{i32 0}` isn't an empty array.

Needed because of r232505.

llvm-svn: 232514
2015-03-17 18:23:38 +00:00
David Blaikie 23f94dfdf4 Update Polly tests for the great metadata schema change
llvm-svn: 231089
2015-03-03 18:17:26 +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 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 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
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
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 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
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 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 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
Duncan P. N. Exon Smith 52fd68980c DI: LLVM schema change: fold constants into string
Update debug info testcases for the LLVM metadata schema change in
r219010 to fold metadata constant operands into a single `MDString`.

Part of PR17891.

llvm-svn: 219019
2014-10-03 21:08:48 +00:00
Tobias Grosser 1eedb67fa6 We do not support alias checks for base pointers defined inside the SCoP
The run-time alias check places code that involves the base pointer at the
beginning of the SCoP. This breaks if the base pointer is defined inside the
SCoP. Hence, we can only create a run-time alias check if we are sure the base
pointer is not an instruction defined inside the scop. If it is we refuse to
handle the SCoP.

This commit should unbreak most of our current LNT failures.

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

llvm-svn: 218412
2014-09-24 21:04:29 +00:00
Johannes Doerfert b9fb5a2cc6 [RTC] Runtime Alias Checks for the ISL backend (missing tests)
Test files missing in r218046.

llvm-svn: 218047
2014-09-18 11:20:36 +00:00
Tobias Grosser f4daf34496 Revert "Added support for modulo expressions"
This reverts commit 215684. The intention of the commit is great, but
unfortunately it seems to be the cause of 14 LNT test suite failures:

http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly/builds/116

To make our buildbots and performance testers green until this issue is solved,
we temporarily revert this commit.

llvm-svn: 215816
2014-08-16 09:08:55 +00:00
Johannes Doerfert 5130c849aa Added support for modulo expressions
The support is limited to signed modulo access and condition
  expressions with a constant right hand side, e.g., A[i % 2] or
  A[i % 9]. Test cases are modified according to this new feature and
  new test cases are added.

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

llvm-svn: 215684
2014-08-15 01:14:11 +00:00
Johannes Doerfert 43e1eadf26 [Refactor] Use attributes to mark function as invalid for polly
+ Test case annotated with the new attribute
  + Modified test case to check if subfunctions are annotated

llvm-svn: 213093
2014-07-15 21:06:48 +00:00
Andreas Simbuerger b379edbb3e Don't expand to invalid Scops with -polly-detect-keep-going
Enabling -keep-going in ScopDetection causes expansion to an invalid
Scop candidate.

Region A     <- Valid candidate
   |
Region B     <- Invalid candidate

If -keep-going is enabled, ScopDetection would expand A to A+B because
the RejectLog is never checked for errors during expansion.

With this patch only A becomes a valid Scop.

llvm-svn: 211875
2014-06-27 06:21:14 +00:00
Sebastian Pop e8863b8f00 correct the delinearization failing case
collect terms from affine and non affine memory accesses

llvm-svn: 208616
2014-05-12 19:02:02 +00:00
Tobias Grosser 28a70c543d ScopDetect: Transitively remove all children after region expansion
In rare cases, a region R which is itself not valid has an indirect child region
that is valid. When R becomes part of a valid region by expansion of another
region, then all children of R have to be erased from the set of valid regions.
This patch ensures that indirect children are erased in addition to direct
children.

Contributed-by: Armin Groesslinger <armin.groesslinger@uni-passau.de>

Tobias: I added a reduced test case and adjusted the logic of the patch to
        only recurse until the first child is found.
llvm-svn: 200411
2014-01-29 19:05:30 +00:00
Tobias Grosser 458fb78cfa Check if array base addresses are invariant
Array base addresses need to be invariant in the region considered. The base
address has to be computed outside the region, or, when it is computed inside,
the value must not change with the iterations of the loops. For example, when a
two-dimensional array is represented as a pointer to pointers the base address
A[i] in an access A[i][j] changes with i; therefore, such regions have to be
rejected.

Contributed by:  Armin Größlinger <armin.groesslinger@uni-passau.de>

llvm-svn: 200314
2014-01-28 12:58:58 +00:00
Tobias Grosser 5b5daab9f1 Add more test cases to check loop invariance of the base pointer.
llvm-svn: 200305
2014-01-28 10:29:17 +00:00
Tobias Grosser 8519f897e7 Report detected scops using the new diagnostics
We now report the following:

$ polly-clang -O3 -mllvm -polly -mllvm -polly-report test.c  -c \
  -gline-tables-only

note: Polly detected an optimizable loop region (scop) in function 'foo'
test.c:2: Start of scop
test.c:3: End of scop
note: Polly detected an optimizable loop region (scop) in function 'bar'
test.c:9: Start of scop
test.c:13: End of scop

llvm-svn: 197558
2013-12-18 10:49:53 +00:00
Tobias Grosser 6bcb34b180 ScopDetect: Add some test cases for sequential loops
llvm-svn: 187024
2013-07-24 06:10:37 +00:00
Sebastian Pop 784c012982 scop detection: remove an iteration over all uses
reenabled reverted patch after checking that it passes without regressions on
the nightly test-suite.  Added testcase from Tobi.

llvm-svn: 185720
2013-07-05 20:24:47 +00:00
Sebastian Pop 9d63234ad1 ScopDetect: check region entering edges are valid.
When a region header is part of a loop, then all entering edges of this region
should not come from the loop but outside the region. Otherwise, the loop may be
only partially part of the region, which would cause troubles in handling
induction variables.

Currently, we can only model induction variables that are either fully part of
the scop (loop induction variable) or induction variables that are scop-
invariant (parameter). A loop that is only partially part of the
scop causes troubles, as there is no good way to handle the induction
variable in the independent blocks pass.

Contributed-by:    Star Tan <tanmx_star@yeah.net>
llvm-svn: 183800
2013-06-11 22:20:40 +00:00
Sebastian Pop 2c9ec2e651 scop detection: do not run scop detection on regions without loops
otherwise, use -polly-detect-scops-in-regions-without-loops to also detect scops
in regions without loops

llvm-svn: 183113
2013-06-03 16:35:37 +00:00