Commit Graph

3918 Commits

Author SHA1 Message Date
Chandler Carruth 11b89c56cc [TI removal] Generically discuss terminators rather than use the soon to
vanish subclass name.

llvm-svn: 344728
2018-10-18 07:43:30 +00:00
Theodoros Theodoridis c0daf2a978 Fix broken formatting caused by test commit
llvm-svn: 344694
2018-10-17 15:01:18 +00:00
Theodoros Theodoridis 7c8f91aa60 Test commit
llvm-svn: 344682
2018-10-17 09:59:41 +00:00
Chandler Carruth e303c87e19 [TI removal] Make `getTerminator()` return a generic `Instruction`.
This removes the primary remaining API producing `TerminatorInst` which
will reduce the rate at which code is introduced trying to use it and
generally make it much easier to remove the remaining APIs across the
codebase.

Also clean up some of the stragglers that the previous mechanical update
of variables missed.

Users of LLVM and out-of-tree code generally will need to update any
explicit variable types to handle this. Replacing `TerminatorInst` with
`Instruction` (or `auto`) almost always works. Most of these edits were
made in prior commits using the perl one-liner:
```
perl -i -ple 's/TerminatorInst(\b.* = .*getTerminator\(\))/Instruction\1/g'
```

This also my break some rare use cases where people overload for both
`Instruction` and `TerminatorInst`, but these should be easily fixed by
removing the `TerminatorInst` overload.

llvm-svn: 344504
2018-10-15 10:42:50 +00:00
Zachary Turner 4b6f60073a Fix another error related to YAML quoting.
This one occured in polly, which I didn't build / test the first
time so I didn't catch it.

llvm-svn: 344378
2018-10-12 17:28:39 +00:00
Michael Kruse 7860c5fe4e [IslAst] Fix InParallelFor nesting.
IslAst could mark two nested outer loops as "OutermostParallel". It
caused that the code generator tried to OpenMP-parallelize both loops,
which it is not prepared loop.

It was because the recursive AST build algorithm managed a flag
"InParallelFor" to ensure that no nested loop is also marked as
"OutermostParallel". Unfortunatetly the same flag was used by nodes
marked as SIMD, and reset to false after the SIMD node. Since loops can
be marked as SIMD inside "OutermostParallel" loops, the recursive
algorithm again tried to mark loops as "OutermostParellel" although
still nested inside another "OutermostParallel" loop.

The fix exposed another bug: The function "astScheduleDimIsParallel" was
only called when a loop was potentially "OutermostParallel" or
"InnermostParallel", but as a side-effect also determines the minimum
dependence distance. Hence, changing when we need to know whether a loop
is "OutermostParallel" also changed which loop was annotated with
"#pragma minimal dependence distance".

Moreover, some complex condition linked with "InParallelFor" determined
whether a loop should be an "InnermostParallel" loop. It missed some
situations where it would not use mark as such although being inside an
SIMD mark node, and therefore not be annotated using "#pragma simd".

The changes in particular:

1. Split the "InParallelFor" flag into an "InParallelFor" and an
   "InSIMD" flag.

2. Unconditionally call "astScheduleDimIsParallel" for its side-effects
   and store the result in "InParallel" for later use.

3. Simplify the condition when a loop is "InnermostParallel".

Fixes llvm.org/PR33153 and llvm.org/PR38073.

llvm-svn: 343212
2018-09-27 13:39:37 +00:00
Michael Kruse 3b4d331d8c [doc] Fix HowToManuallyUseTheIndividualPiecesOfPolly
Also remove compiled binaries.

llvm-svn: 343119
2018-09-26 15:22:39 +00:00
Michael Kruse fe7bd34b79 Move www/experiments to docs/experiments
llvm-svn: 343118
2018-09-26 15:21:43 +00:00
Sylvestre Ledru eaf601ab7a fix the scan-build urls
llvm-svn: 342716
2018-09-21 09:07:58 +00:00
Eli Friedman efe18d3977 [ScopDetection] Use addUnknown for calls in the AliasSetTracker.
The general-purpose add() now sometimes adds unexpected loop-variant
pointers to the AliasSetTracker, so certain loops would be rejected with
-polly-allow-modref-calls.  Use addUnknown() instead, which has the old
behavior.

I'm not completely convinced the resulting behavior is actually
correct: ScopDetection::isValidAccess seems to mostly ignore
"unknown" instructions in the AliasSetTracker.  But it's not any worse
than what was happening before.

Committing without pre-commit review to unbreak the buildbots; the
following tests were failing:

test/ScopInfo/mod_ref_access_pointee_arguments.ll
test/ScopInfo/mod_ref_read_pointee_arguments.ll
test/ScopInfo/multidim_2d_with_modref_call_2.ll

llvm-svn: 342010
2018-09-11 23:48:14 +00:00
Tobias Grosser 4beb2f964b [PerfMonitor] Fix rdtscp callsites
Summary:
Update all rdtscp callsites in PerfMonitor so that they conform with the signature changes introduced in r341698.

Reviewers: grosser, bollu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51928

llvm-svn: 341946
2018-09-11 14:17:44 +00:00
Chandler Carruth 9ae926b973 [IR] Replace `isa<TerminatorInst>` with `isTerminator()`.
This is a bit awkward in a handful of places where we didn't even have
an instruction and now we have to see if we can build one. But on the
whole, this seems like a win and at worst a reasonable cost for removing
`TerminatorInst`.

All of this is part of the removal of `TerminatorInst` from the
`Instruction` type hierarchy.

llvm-svn: 340701
2018-08-26 09:51:22 +00:00
Michael Kruse b67e5d3f27 [AST] Adapt Polly to AnalysisSetTracker changes. NFC.
The method AliasSetTracker::getAliasSetForPointer was removed and replaced by AliasSetTracker::getAliasSetFor for the restructuring in r339930. 

Since Polly uses AliasSetTracker::getAliasSetForPointer, a temporary fix has been committed in r339937 with a comment:

     Can someone from polly please migrate usage and then delete the wrapper?

This commit is doing exactly that.

llvm-svn: 340072
2018-08-17 19:31:41 +00:00
Michael Kruse 0e4e6e5e87 [DepInfo] Use isl++ in Dependences::isValidSchedule. NFC.
Also change StatementToIslMapTy to hold isl::map, because it is used as a
parameter.

llvm-svn: 339484
2018-08-10 22:33:27 +00:00
Tobias Grosser 7164b7d347 Update isl-cpp bindings
We upstreamed the export of isl_val_2exp, to the official cpp bindings.
In this process, we concluded that pow2 is a better and more widely used
name for this functionality. Hence, both the official isl-cpp bindings
and our derived variant use now the term pow2.

llvm-svn: 339312
2018-08-09 05:07:14 +00:00
Tobias Grosser 26269d34d4 Update to isl-0.20-65-gb822a210
This update fixes https://https:/llvm.org/PR38348. Thanks Michael for
reporting the issue to isl and Sven for fixing the issue.

llvm-svn: 339311
2018-08-09 05:07:05 +00:00
Tobias Grosser 6145b11cd8 Update isl to isl-0.20-48-g13eba5b5
This is a regular maintenance updated.

llvm-svn: 339095
2018-08-07 05:51:21 +00:00
Tobias Grosser b8a55e1eee Make update-isl work with latest isl versions
Latest isl versions require clang to build a 'dist' package. Make sure
we actually ask for it.

While being there, also make sure we build isl on all cores.

llvm-svn: 339094
2018-08-07 05:50:58 +00:00
Michael Kruse ebca0f1609 [JSONExporter] Print instead of ignoring parser error.
Silence the warning

    warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]

JSONExporter is a developer tool, there is no mechanism for error
handling. Print the parser error and abort with a fatal error.

llvm-svn: 338659
2018-08-02 00:11:14 +00:00
Michael Kruse 842bdd0071 [ScopBuilder] Set domain to empty instead of NULL.
The domain generation used nullptr to mark the domain of an error block
as never-executed. Later, nullptr domains are recreated with a
zero-tuple domain that then mismatches with the expected domain the
error block within the loop.

Instead of using nullptr, assign an empty domain which preserves the
expected space. Remove empty domains during SCoP simplification.

Fixes llvm.org/PR38218.

llvm-svn: 338646
2018-08-01 22:28:32 +00:00
Hans Wennborg 7d02a3177d Update docs version and clear release notes after 8.0.0 version bump
llvm-svn: 338560
2018-08-01 14:11:32 +00:00
Tobias Grosser 5f865032db PPCG codegen
The latest version of the isl C++ bindings does not export the 'set'
method yet. Fall back to the C interface until this method can be
exported.

llvm-svn: 338512
2018-08-01 10:48:38 +00:00
Tobias Grosser 4b53d74e89 [isl++] drop the isl namespace qualifiers [NFC]
These namespace qualifiers are not needed. Dropping them brings us
closer to the official isl namespace qualifiers.

While the delta of this change set is large, it only mechanically drops
the 'isl::' prefixes.

llvm-svn: 338505
2018-08-01 09:57:36 +00:00
Tobias Grosser a2fd441989 Rebase C++ bindings on top of latest isl bindings
The main difference in this change is that isl_stat is now always
checked by default. As we elminiated most used of isl_stat, thanks to
Philip Pfaffe's implementation of foreach, only a small set of changes
is needed.

This change does not include the following recent changes to isl's C++
bindings:

  - stricter error handling for isl_bool
  - dropping of the isl::namespace qualifiers

The former requires a larger patch in Polly and consequently should go
through a patch-review. The latter will be applied in the next commit to
keep this commit free from noise.

We also still apply a couple of other changes on top of the official isl
bindings. This delta is expected to shrink over time.

llvm-svn: 338504
2018-08-01 09:57:10 +00:00
Tobias Grosser d169d70bbf Update to isl-0.20-35-ge0a98b62
llvm-svn: 338501
2018-08-01 09:20:03 +00:00
Michael Kruse 37b3c1775b [JSONExporter] Try to appease buildbot. NFC.
The compiler does not seem to able move a local variable in the
function's return statement.

llvm-svn: 338466
2018-08-01 00:48:01 +00:00
Michael Kruse 42ad818265 [Polly-ACC] Fix compilation after r338450. NFC.
llvm-svn: 338462
2018-08-01 00:27:29 +00:00
Michael Kruse 23655020a2 [JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC.
Differential Revision: https://reviews.llvm.org/D49950

llvm-svn: 338461
2018-08-01 00:15:16 +00:00
Michael Kruse e873673b0c [CodeGen] Convert IslNodeBuilder::getNumberOfIterations to isl++. NFC.
llvm-svn: 338451
2018-07-31 23:01:50 +00:00
Michael Kruse f16378b080 [CodeGen] Convert IslNodeBuilder::createForSequential to isl++. NFC.
llvm-svn: 338450
2018-07-31 22:43:04 +00:00
Michael Kruse ade2242e7e [CodeGen] Convert IslNodeBuilder::getUpperBound to isl++. NFC.
llvm-svn: 338449
2018-07-31 22:42:59 +00:00
Michael Kruse 60e2a321e5 [test] Remove non-JSPON comments in JSCOP file. NFC.
llvm-svn: 338185
2018-07-28 01:11:45 +00:00
Philip Pfaffe 4f4dfbacad [isl] Simplify iterator implementation by building on top of list accessors
Summary:
With the new accessors, it's straightforward to use the templated
iterator instead of subclassing it for all the list types.

Depends on D49019

Reviewers: grosser, Meinersbur, bollu

Reviewed By: grosser

Subscribers: mehdi_amini, steven_wu, dexonsmith, pollydev, llvm-commits

Differential Revision: https://reviews.llvm.org/D49021

llvm-svn: 337702
2018-07-23 15:28:50 +00:00
Tobias Grosser 6d69f92864 [DependenceInfo] Use isl++ to replace foreach_set with for loop
llvm-svn: 337248
2018-07-17 07:08:06 +00:00
Tobias Grosser 670482db8b [IslNodeBuilder] Use isl++ to replace foreach_set with for loop
llvm-svn: 337247
2018-07-17 07:08:01 +00:00
Tobias Grosser a98c7e7309 [ScopInfo] Replace isl foreach calls with for loops
llvm-svn: 337246
2018-07-17 06:41:20 +00:00
Tobias Grosser bbb510b18d [ZoneAlgo] Replace isl foreach calls with for loops
llvm-svn: 337245
2018-07-17 06:33:41 +00:00
Tobias Grosser c253931fcf [FlattenSchedule] Replace isl foreach calls with for loops
llvm-svn: 337244
2018-07-17 06:33:37 +00:00
Tobias Grosser 3867bae74b [MaximalStaticExpansion] Replace isl foreach calls with for loops
llvm-svn: 337243
2018-07-17 06:33:34 +00:00
Tobias Grosser 91f851b11a [ForwardOpTree] Replace isl foreach calls with for loops
llvm-svn: 337242
2018-07-17 06:33:31 +00:00
Tobias Grosser a33871686f [Simplify] Replace isl foreach calls with for loops
llvm-svn: 337241
2018-07-17 06:33:26 +00:00
Tobias Grosser 9d8913020d [FlattenAlgo] Replace more isl foreach calls with for loops
This time we replace for loops where the return isl::stat::error has
been used to carry status information.

There are still two uses of foreach remaining as we do not have a
corresponding for implementation for pw_aff functions.

llvm-svn: 337239
2018-07-17 06:16:58 +00:00
Tobias Grosser 6106595ac1 [FlattenAlgo] Replace some isl foreach calls with for loops
Replace foreach calls which only return 'ok' with for loops.

llvm-svn: 337238
2018-07-17 06:11:53 +00:00
Tobias Grosser 046c97876a [unittest/DeLICM] Replace isl foreach calls with for loops
llvm-svn: 337237
2018-07-17 06:08:04 +00:00
Tobias Grosser 31e29a4b59 [ScopInfo] Replace isl foreach calls with for loops
After Philip added support for range-based for loops to our C++
bindings, we now convert another bunch of foreach calls to range-for loops.
This improves general readability of the code.

llvm-svn: 337201
2018-07-16 19:04:16 +00:00
Philip Pfaffe ee51d5c64e [Polly][isl] Add neutrally-named accessors to isl list elements and sizes
Summary: This could simplify the isl iterator implementation a lot.

Reviewers: grosser, Meinersbur, bollu

Reviewed By: grosser

Subscribers: pollydev, llvm-commits

Differential Revision: https://reviews.llvm.org/D49019

llvm-svn: 337054
2018-07-13 22:05:01 +00:00
Michael Kruse cd4d873d15 [Docs] Fix generation of manpages.
Fix the following error when Sphinx generates the Polly manpage:

    Warning, treated as error:
    docs/Performance.rst:: WARNING: "table cell spanning" not supported

llvm-svn: 336600
2018-07-09 20:26:11 +00:00
Philip Pfaffe 492cdfc5fb Add a file that was missing in r336425
llvm-svn: 336430
2018-07-06 11:33:35 +00:00
Tobias Grosser b370615451 Update isl to isl-0.19-224-gce84a511
This is a maintenance update. Besides many minor changes it ships two
functions "isl_*_list_size" and "isl_*_list_get_at" which will allow us
to simplify the iterator implementation in Polly.

llvm-svn: 336425
2018-07-06 09:00:26 +00:00
Tobias Grosser 4aab4ec836 [ScopInfo] Move foldSizeConstantsToRight() to isl++
Summary: This patch updates the isl interface used in `foldSizeConstantsToRight()` to the new C++ interface.

Reviewers: chelini, grosser, philip.pfaffe, Meinersbur

Reviewed By: grosser

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D48965

llvm-svn: 336362
2018-07-05 15:23:28 +00:00
Michael Kruse 9f305371d9 [CodeGen] Fix potential null pointer dereference. NFC.
ScalarEvolution::getSCEV dereferences its argument, s.t. passing nullptr
leads to undefined behaviour.

Check for nullptr before calling it instead of checking its argument
afterwards.

llvm-svn: 336350
2018-07-05 13:44:50 +00:00
Siddharth Bhat 936c74ad0d [PPCGCodeGen] Change printf to outs() to prevent garbled output. [NFC]
Summary:
It appears that llvm uses unbuffered C++ streams. So, we should not
mix C and C++ stream operations, because that will give us mixed
up output.

Reviewers: efriedma, jdoerfert, Meinersbur, gareevroman, sebpop, zinob, huihuiz, pollydev, grosser, singam-sanjay, philip.pfaffe

Reviewed By: philip.pfaffe

Subscribers: nemanjai, kbarton

Differential Revision: https://reviews.llvm.org/D40126

llvm-svn: 336288
2018-07-04 16:51:27 +00:00
Tobias Grosser a66ab832a0 ScopInfo: simplify equivalence classes before storing them [NFCI]
This change has no impact on upstream Polly directly, but reduces output
noise for some internal isl versions we are testing. In general, storing
simpler and more canonical output is a good idea. Hence, it seems useful
to upstream this change.

llvm-svn: 336281
2018-07-04 14:53:36 +00:00
Siddharth Bhat 98a7a31d1e [Polly-ACC] Add isl_space.h to gpu_tree.c
Summary:
This patch adds <isl_space.h> to gpu_tree.c. This prevents a segfault
when allocating a new isl_space in the function create_sync_domain(), as
the compiler now knows that the return type is a pointer instead of
assuming the function returns an int.

This has been updated in upstream PPCG, so we should bump up our PPCG
version.

Initially discovered by Philip Pfaffe in Polly.

Reviewers: grosser, bollu, philip.pfaffe

Reviewed By: bollu

Subscribers: nemanjai, kbarton, llvm-commits

Differential Revision: https://reviews.llvm.org/D48883

Contributed-by: Alain Denzler <alaindenzler@gmail.com>
llvm-svn: 336251
2018-07-04 09:40:55 +00:00
Philip Pfaffe cb8a82929c Fix for r336080: Missing colon in REQUIRES line
llvm-svn: 336083
2018-07-02 08:36:49 +00:00
Philip Pfaffe d71493cb06 [polly-acc] change cl_get_* return types to 32/64bit
Summary:
This patch changes the return types for ocl_get_* functions during SPIR code generation. Because these functions return size_t types, the return type needs to be changed to the actual size of size_t on the device.

Based on work by Michal Babej and Pekka Jääskeläinen

Patch by: Alain Denzler

Reviewers: grosser, philip.pfaffe, bollu

Reviewed By: grosser, philip.pfaffe

Subscribers: nemanjai, kbarton, llvm-commits

Differential Revision: https://reviews.llvm.org/D48774

llvm-svn: 336080
2018-07-02 07:40:47 +00:00
Tobias Grosser d43114f880 Use range for in normalizeValInst [NFCI]
llvm-svn: 335971
2018-06-29 13:06:44 +00:00
Tobias Grosser 1696e48e79 Translate a couple of foreach callbacks into range-based iterator loops
Thanks to Philip Pfaffe for providing iterator support in the previous
commit.

llvm-svn: 335970
2018-06-29 12:23:48 +00:00
Tobias Grosser da82da8a20 Add missing namespace specifier
llvm-svn: 335966
2018-06-29 11:49:34 +00:00
Philip Pfaffe 2f3eff86b1 [NFC] Fix formatting to appease builders
llvm-svn: 335952
2018-06-29 08:29:17 +00:00
Philip Pfaffe 52025af1da Implement an iterator for isl maps, basic_maps, sets, basic_sets
Summary:
Provide an iterator to simplify iteration over some isl collections.
Since these types do not natively support iteration, they have to be converted
to an list first by the caller, but can then be used in a ranged for loop:
```
isl::set S;
for (auto SubSet : S.get_basic_set_list ()) {
  // ...
}
```

Reviewers: bollu, Meinersbur, grosser, dexonsmith

Reviewed By: bollu

Subscribers: hfinkel, mgorny, Meinersbur, mehdi_amini, bollu, steven_wu, llvm-commits

Differential Revision: https://reviews.llvm.org/D48136

llvm-svn: 335951
2018-06-29 08:17:03 +00:00
Philip Pfaffe ec1a3048a3 [ScopHelper] Provide support for recognising collective invariant loads
Summary: This patch aims to provide support for detecting load patterns which are collectively invariant but right now `isHoistableLoad()` is checking each load instruction individually which cannot detect the load pattern as a whole.

Patch by: Sahil Girish Yerawar

Reviewers: bollu, philip.pfaffe, Meinersbur

Reviewed By: philip.pfaffe, Meinersbur

Differential Revision: https://reviews.llvm.org/D48026

llvm-svn: 335949
2018-06-29 07:29:45 +00:00
Tobias Grosser 17a098dedf test: use regex matchers to make test-case robust against register renumberings
Suggested-by: Michael Kruse
llvm-svn: 335813
2018-06-28 07:11:48 +00:00
Eli Friedman 199caa2e80 [ScopHelper] Cache ScopExpander results.
The number of SCEV expressions is usually linear in the number of IR
instructions being modeled.  However, a naive SCEV visitor is not. For
an expression like x*x, "x" will be visited twice.  If x is itself an
expression like x*x, that will be visited twice, etc, and the overall
runtime is O(2^N) in the number of SCEV expressions.

To prevent this from happening, add a cache, so we only visit each SCEV
expression once.

Not sure this is the best solution. Maybe we can instead check whether
the SCEV is scop-invariant (in which case we never need to map the
value). But we don't have a utility for that at the moment.

Differential Revision: https://reviews.llvm.org/D47087

llvm-svn: 335783
2018-06-27 20:35:02 +00:00
Michael Kruse 96da1ca584 [ZoneAlgo] Use getDefToTarget in makeValInst. NFC.
Move the optimized getDefToTarget() from ForwardOpTree to ZoneAlgo such
that it can be used by makeValInst.

This reduces the compile time of GrTestUtils of the aosp buildbot from
2m46s to 21s, which should fix the timeout issue.

Differential Revision: https://reviews.llvm.org/D48579

llvm-svn: 335606
2018-06-26 14:29:09 +00:00
Tim Shen 63f244c4f4 [SCEV] Re-apply r335197 (with Polly fixes).
Summary:
This initiates a discussion on changing Polly accordingly while re-applying r335197 (D48338).

I have never worked on Polly. The proposed change to param_div_div_div_2.ll is not educated, but just patterns that match the output.

All LLVM files are already reviewed in D48338.

Reviewers: jdoerfert, bollu, efriedma

Subscribers: jlebar, sanjoy, hiraditya, llvm-commits, bixia

Differential Revision: https://reviews.llvm.org/D48453

llvm-svn: 335292
2018-06-21 21:29:54 +00:00
Tobias Grosser 6ec6e1d6d6 Move ScopInfo to isl++
llvm-svn: 335029
2018-06-19 08:13:53 +00:00
Tobias Grosser 67dc08bd4c Adjust for clang-format changes
llvm-svn: 334941
2018-06-18 13:01:52 +00:00
Tobias Grosser 09a5437886 [ScopInfo] Move splitAliasGroupsByDomain and getAccessDomain to isl++ [NFCI]
llvm-svn: 334940
2018-06-18 12:53:26 +00:00
Tobias Grosser 9b29af946f [ScopInfo] Move more functions to isl++ [NFCI]
This change includes:

  - getFortranArrayIds
  - adjustDomainDimensions
  - propagateInvalidStmtDomains
  - buildAliasGroupsForAccesses

llvm-svn: 334939
2018-06-18 12:49:47 +00:00
Tobias Grosser 85dfb53e32 [ScopInfo] Move addNonEmptyDomainConstraints to isl++ [NFCI]
llvm-svn: 334938
2018-06-18 12:41:58 +00:00
Tobias Grosser fd5c856fe5 Move buildConditionSet to C++
llvm-svn: 334937
2018-06-18 12:35:36 +00:00
Paul Robinson 7555c589af Update copyright year to 2018.
llvm-svn: 334936
2018-06-18 12:22:17 +00:00
Tobias Grosser a78a809afc Adjust to recent LLVM changes to fix buildbots
llvm-svn: 334893
2018-06-16 17:38:19 +00:00
Philip Pfaffe 66a05ad672 Simplify the implementation of getCUDALibDeviceFunction. NFC.
Summary:
The function is currently awfully complicated. Drop the IILE and use
StringRef over std::string.

Reviewers: Meinersbur, grosser, bollu

Reviewed By: Meinersbur

Subscribers: nemanjai, kbarton, bollu, llvm-commits, pollydev

Differential Revision: https://reviews.llvm.org/D48070

llvm-svn: 334695
2018-06-14 08:54:55 +00:00
Tobias Grosser ee5762cfab [test] Fix a typo in a test case [NFCI]
Also remove an undef value that does not add any value to the test case.

llvm-svn: 334661
2018-06-13 21:46:29 +00:00
Tobias Grosser 6538f40e31 Drop unnecessary whitespace [NFCI]
llvm-svn: 334413
2018-06-11 15:11:57 +00:00
Tobias Grosser 80677bce11 [ScopBuilder] Slightly improve code structure [NFCI]
First build the surrounding loops and then build up the polyhedral
structures. Before r326664 we had to mix these updates, clean this
up to improve readability (slightly).

llvm-svn: 334412
2018-06-11 14:59:28 +00:00
Tobias Grosser 2c543e775f Update isl to isl-0.19-185-g8e9f55ce
This is mainly a maintenance update.

llvm-svn: 334406
2018-06-11 14:25:42 +00:00
Krzysztof Parzyszek fb3ed4f409 [Polly] Fix a testcase after LLVM commit r334318
ScalarEvolution has become slightly more intelligent, so obfuscate the
exit condition in the testcase some more to keep it working.

llvm-svn: 334327
2018-06-08 21:39:55 +00:00
Philip Pfaffe 4d24093ac4 Back out of GPU Codegen if NVPTX is not available
Summary:
When enabling GPU codegen in polly, CMake will fail if NVPTX is not a target
supported by the LLVM polly is being built against. In that case, GPU codegen
should be switched off.

Reviewers: Meinersbur, grosser, bollu

Reviewed By: Meinersbur

Subscribers: mgorny, bollu, pollydev, llvm-commits

Differential Revision: https://reviews.llvm.org/D47888

llvm-svn: 334233
2018-06-07 21:10:49 +00:00
Philip Pfaffe e6e1828004 Run clang-format
llvm-svn: 334172
2018-06-07 08:32:13 +00:00
Philip Pfaffe 30c5e4ad35 Fix a missing lambda return type that tripped the builders
llvm-svn: 334166
2018-06-07 07:50:55 +00:00
Michael Kruse 2dab88e652 [OpTree] Introduce shortcut for computing the def->target mapping. NFCI.
In case the schedule has not changed and the operand tree root uses a
value defined in an ancestor loop, the def-to-target mapping is trivial.
For instance, the SCoP

    for (int i < 0; i < N; i+=1) {
    DefStmt:
      D = ...;
      for (int j < 0; j < N; j+=1) {
    TargetStmt:
        use(D);
      }
    }

has DefStmt-to-TargetStmt mapping of

    { DefStmt[i] -> TargetStmt[i,j] }

This should apply on the majority of def-to-target mappings.
This patch detects this case and directly constructs the expected
mapping. It assumes that the mapping never crosses the loop header
DefStmt is in, which ForwardOpTree does not support at the moment
anyway.

Differential Revision: https://reviews.llvm.org/D47752

llvm-svn: 334134
2018-06-06 21:37:35 +00:00
Tobias Grosser 6a6d9df78e getDependences to new C++ interface
Reviewers: Meinersbur, grosser, bollu, cs15btech11044, jdoerfert

Reviewed By: grosser

Subscribers: pollydev, llvm-commits

Tags: #polly

Differential Revision: https://reviews.llvm.org/D47786

llvm-svn: 334092
2018-06-06 13:10:32 +00:00
Tobias Grosser a998f98ba6 Fix formatting
llvm-svn: 333988
2018-06-05 09:03:46 +00:00
David Blaikie 4490465db7 Update for a header file move in LLVM
llvm-svn: 333956
2018-06-04 21:23:32 +00:00
Tobias Grosser 78a8494eb5 partitionSetParts from C to C++ interface.
Summary: partitionSetParts from C to new C++ interface.

Reviewers: grosser, Meinersbur, jdoerfert, bollu, cs15btech11044

Reviewed By: grosser, Meinersbur

Subscribers: llvm-commits, pollydev

Tags: #polly

Differential Revision: https://reviews.llvm.org/D47252

llvm-svn: 333780
2018-06-01 19:12:00 +00:00
Michael Kruse d51fbfca46 [ZoneAlgo] Make ZoneAlgorithm::isNormalized out-of-quota safe.
The aosp-O3-polly-before-vectorizer-unprofitable buildbot currently
fails in ZoneAlgorithm::isNormalized, presumably because an
out-of-quota happens in that function.

Modify ZoneAlgorithm::isNormalized to return an isl::boolean such
it can report an error.

In the failing case, it was called in an assertion in ForwardOpTree.
Allow to pass the assertion in an out-of-quota event, a condition that
is later checked before forwarding an operand tree.

llvm-svn: 333709
2018-05-31 22:44:23 +00:00
Tobias Grosser 4dcd83fcd2 Update isl C++ bindings
This update adds new list types and adds functions which convert isl
data types to lists of their contained elements:

  isl::set::get_basic_set_list
  isl::union_set::get_set_list

  isl::map::get_basic_map_list
  isl::union_map::get_map_list

llvm-svn: 333688
2018-05-31 19:48:23 +00:00
Tobias Grosser ce27773a8e Update isl to isl-0.19-173-g77fe2538
Besides other changes, this update introduces functions to translate a
maps and sets into lists of their elements. These lists are useful as
we can define iterators for lists, which allow us to replace many uses
of foreach.

llvm-svn: 333621
2018-05-31 03:59:05 +00:00
Michael Kruse d3ce899ddf [ForwardOpTree] Use less computationally expensive method to compute def-to-target map. NFCI.
When forwarding a LoadInst to another statement, a map that translates
their domain is needed. Before this patch, is was computed by appending
the def-to-use map to the def-to-target of the operand tree's target.

This patch lets the new method getDefToTarget do this. This is
computationally less expensive due to:

 * Caching of the result such that it can be used for multiple operands
   tree to the same target.

 * The map is only computed when there is a LoadInst that needs it.

 * It is only computed for the statement requiring the translator map,
   instead of having an intermediate result for every edge in the
  operand tree.

The downside is that this scheme cannot handle forwarding from a
previous loop iteration (which would require the entire path from
statement to target). Since ForwardOpTree currently does not support
forwarding across loop iterations (SCEV expressions would need to be
transformed), this was not needed anyway.

Differential Revision: https://reviews.llvm.org/D47385

llvm-svn: 333426
2018-05-29 15:19:17 +00:00
Tobias Grosser 9b9c701020 [ScopInfo] Update Scop::addUserContext() to C++ interface
Summary: This patch updates `Scop::addUserContext()` function to the new C++ interface and replaces the `auto` keyword with explicit type wherever used in this function.

Reviewers: grosser, bollu, philip.pfaffe, chelini, Meinersbur

Reviewed By: grosser

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D47438

llvm-svn: 333366
2018-05-28 07:45:25 +00:00
Philip Pfaffe 7cc4300dac [Acc] Followup for r333105: Fix one additional testcase
llvm-svn: 333168
2018-05-24 10:18:09 +00:00
Tobias Grosser 79e3f2c6e2 Update isl to isl-0.19-152-g437e6ab0
Besides normal updates this change also contains a bug-fix to in
isl_coalesce which broke the AOSP buildbot. Thanks to Michael Kruse for
reporting this bug and Sven Verdoolage for fixing this bug.

llvm-svn: 333118
2018-05-23 20:18:50 +00:00
Tobias Grosser 10da5a0ae7 createNextIterationMap from C to C++ interface
Summary: update createNextIterationMap function to new C++ interface.

Reviewers: grosser, Meinersbur, jdoerfert, bollu, cs15btech11044

Reviewed By: cs15btech11044

Subscribers: llvm-commits, pollydev

Tags: #polly

Differential Revision: https://reviews.llvm.org/D47102

llvm-svn: 333113
2018-05-23 18:41:40 +00:00
Philip Pfaffe 356d60683b [Acc] Enable legacy stmt granularity in remaining failing testcases
The default statement granularity changed in a recent change by Micheal. To
avoid forwad-porting the testcases, enable the legacy behaviour again in these tests.

llvm-svn: 333105
2018-05-23 17:46:10 +00:00
Philip Pfaffe 2e171b52ee [Acc] Update testcases for minor changes in the PPCG mapper and
statement naming

- A recent ppcg/isl update caused the grid/block size upper bounds to
deviate by one from the oracle. This is not an effect that's visible at
runtime.
- Statement naming changed in polly. Update the testcases.

llvm-svn: 333090
2018-05-23 14:56:57 +00:00
Philip Pfaffe c06a6380a0 [Acc] Re-land r326643 to finally fix PR33208.
Other than before, don't clear out LI entirely but only those relevant
loops.

llvm-svn: 333089
2018-05-23 14:52:35 +00:00
Peter Collingbourne 9a45114b3c CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to dwo output.
Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47089

llvm-svn: 332881
2018-05-21 20:16:41 +00:00