Commit Graph

1587 Commits

Author SHA1 Message Date
Tanya Lattner 62dba3b7b6 Update links to lists.llvm.org.
llvm-svn: 244009
2015-08-05 04:19:04 +00:00
Tobias Grosser dcc3b435ab Optionally model read-only scalars
Even though read-only accesses to scalars outside of a scop do not need to be
modeled to derive valid transformations or to generate valid sequential code,
but information about them is useful when we considering memory footprint
analysis and/or kernel offloading.

llvm-svn: 243981
2015-08-04 13:54:20 +00:00
Tobias Grosser fbe7a2e841 Run ScopInfo after the ScopViewers
This change is required to see the detected scops even in cases where there is
no other ScopInfo user after the ScopViewers. Before this change, when
running with -polly-optimizer=none -polly-code-generator=none detected scops
have not been shown.

llvm-svn: 243971
2015-08-04 11:49:39 +00:00
Tobias Grosser ac3a95f347 Do not add spaces into memory-access identifiers
llvm-svn: 243889
2015-08-03 17:53:21 +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 14e67e43a7 Add option -polly-view-only
If set, this option instructs -view-scops and -polly-show to only print
functions that contain the specified string in their name. This allows to
look at the scops of a specific function in a large .ll file, without flooding
the screen with .dot graphs.

llvm-svn: 243882
2015-08-03 16:39:56 +00:00
Tobias Grosser 6213913244 Use the branch instruction to define the location of a PHI-node write
We use the branch instruction as the location at which a PHI-node write takes
place, instead of the PHI-node itself. This allows us to identify the
basic-block in a region statement which is on the incoming edge of the PHI-node
and for which the write access was originally introduced. As a result we can,
during code generation, avoid generating PHI-node write accesses for basic
blocks that do not preceed the PHI node without having to look at the IR
again.

This change fixes a bug which was introduced in r243420, when we started to
explicitly model PHI-node reads and writes, but dropped some additional checks
that where still necessary during code generation to not emit PHI-node writes
for basic-blocks that are not on incoming edges of the original PHI node.
Compared to the code before r243420 the new code does not need to inspect the IR
any more and we also do not generate multiple redundant writes.

llvm-svn: 243852
2015-08-02 16:17:41 +00:00
Tobias Grosser d2d15a8c65 Dependences: Zero pad the schedule map
The schedule map we derive from a schedule tree map may map statements into
schedule spaces of different dimensionality. This change adds zero padding
to ensure just a single schedule space is used and the translation from
a union_map to an isl_multi_union_pw_aff does not fail.

llvm-svn: 243849
2015-08-02 13:30:33 +00:00
Tobias Grosser 45e7944bcf Only use instructions as insert locations for SCEVExpander
SCEVExpander, which we are using during code generation, only allows
instructions as insert locations, but breaks in case BasicBlock->end() iterators
are passed to it due to it trying to obtain the basic block in which code should
be generated by calling Instruction->getParent(), which is not defined for
->end() iterators.

This change adds an assert to Polly that ensures we only pass valid instructions
to SCEVExpander and it fixes one case, where we used IRBuilder->SetInsertBlock()
to set an ->end() insert location which was later passed to SCEVExpander.

In general, Polly is always trying to build up the CFG first, before we actually
insert instructions into the CFG sceleton. As a result, each basic block should
already have at least one branch instruction before we start adding code. Hence,
always requiring the IRBuilder insert location to be set to a real instruction
should always be possible.

Thanks Utpal Bora <cs14mtech11017@iith.ac.in> for his help with test case
reduction.

llvm-svn: 243830
2015-08-01 09:07:57 +00:00
Tobias Grosser d3f21833b9 Fix typo
llvm-svn: 243829
2015-08-01 06:26:51 +00:00
Duncan P. N. Exon Smith c51714a0c6 Fix polly tests after LLVM IR change in r243774
llvm-svn: 243801
2015-07-31 23:58:50 +00:00
Michael Kruse 471a5e3388 Move computations out of constructors
It is common practice to keep constructors lightweight. The reasons
include:

- The vtable during the constructor's execution is set to the static
type of the object, not to the vtable of the derived class. That is,
method calls behave differently in constructors and ordinary methods.
This way it is possible to call unimplemented methods of abstract
classes, which usually results in a segmentation fault.

- If an exception is thrown in the constructor, the destructor is not
called, potentially leaking memory.

- Code in constructors cannot be called in a regular way, e.g. from
non-constructor methods of derived classes.

- Because it is common practice, people may not expect the constructor
to do more than initializing data and skip them when looking for bugs.

Not all of these are applicable to LLVM (e.g. exceptions are disabled).

This patch refactors out the computational work in the constructors of
Scop and IslAst into regular init functions and introduces static
create-functions as replacement. 

Differential revision: http://reviews.llvm.org/D11491

Reviewers: grosser, jdoerfert
llvm-svn: 243677
2015-07-30 19:27:04 +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 d20aba7047 Remove some dead code
llvm-svn: 243465
2015-07-28 19:16:46 +00:00
Tobias Grosser 2be13913bb Do not end lines with '\'
This fixes 'warning: multi-line comment [-Wcomment]'

llvm-svn: 243464
2015-07-28 19:16:42 +00:00
Tobias Grosser b241d928bd Rewrite getPrevectorMap using schedule trees operations
Schedule trees are a lot easier to work with, for both humans and machines. For
humans the more structured schedule representation is easier to reason about.
Together with the more abstract isl programming interface this can result in a
lot cleaner code (see this changeset). For machines, the structured schedule and
the fact that we now use explicit piecewise affine expressions instead of
integer maps makes it easier to generate code from this schedule tree. As a
result, we can already see a slight compile-time improvement -- for 3mm from
0m0.593s to 0m0.551s seconds (-7 %). More importantly, future optimizations such
as full-partial tile separation will most likely result in more streamlined code
to be generated.

Contributed-by: Roman Gareev <gareevroman@gmail.com>
llvm-svn: 243458
2015-07-28 18:03:36 +00:00
Tobias Grosser 922452285a Keep track of ScopArrayInfo objects that model PHI node storage
Summary:
When translating PHI nodes into memory dependences during code generation we
require two kinds of memory. 'Normal memory' as for all scalar dependences and
'PHI node memory' to store the incoming values of the PHI node. With this
patch we now mark and track these two kinds of memories, which we previously
incorrectly marked as a single memory object.

Being aware of PHI node storage makes code generation easier, as we do not need
to guess what kind of storage a scalar reference requires. This simplifies the
code nicely.

Reviewers: jdoerfert

Subscribers: pollydev, llvm-commits

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

llvm-svn: 243420
2015-07-28 14:53:44 +00:00
Tobias Grosser 9696a3f903 Do not compile GPU library with sanitizers
llvm-svn: 243411
2015-07-28 12:51:23 +00:00
Tobias Grosser 43bf4553fd Extend documentation of scalar code generation [NFC]
No functional change intended

--
Reviewers: jdoerfert

Projects: #polly

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

llvm-svn: 243410
2015-07-28 12:12:04 +00:00
Tobias Grosser d4dd6ec74d Simplify code in BlockGenerator::generateScalarLoads [NFC]
We hoist statements that are used on both branches of an if-condition, shorten
and unify some variable names and fold some variable declarations into their
only uses. We also drop a comment which just describes the elements the loop
iterates over.

No functional change intended.

llvm-svn: 243291
2015-07-27 17:57:58 +00:00
Tobias Grosser 2764794ba4 Simplify some isl expression we use
Suggested-by: Sven Verdoolaege <skimo-polly@kotnet.org>
llvm-svn: 243254
2015-07-26 19:22:35 +00:00
Johannes Doerfert 210b09aa21 Remove explicit heap allocation to fix and prevent memory leaks
llvm-svn: 243245
2015-07-26 13:14:38 +00:00
Tobias Grosser bb853c24b1 Fix formatting of recent alias-analysis commit
llvm-svn: 243215
2015-07-25 12:31:03 +00:00
Tobias Grosser 3b10c94062 Prevectorize the schedule of the band (or the point loop in case of tiling)
Contributed-by: Roman Gareev <gareevroman@gmail.com>
llvm-svn: 243214
2015-07-25 12:28:56 +00:00
Michael Kruse be16d22f04 Normalize whitespace in makefiles
Tabs for rules and space for line continuations.

llvm-svn: 243179
2015-07-24 23:30:31 +00:00
Michael Kruse 392417808d Add isl_ffs.c to file list in autoconf builds
In most configurations it doesn't contain any symbol, but add for
completeness.

llvm-svn: 243168
2015-07-24 21:40:22 +00:00
Michael Kruse 1bbe346cef Make the lit configuration Python 3 compatible
by using the same techniques as LLVM's lit configuration.

llvm-svn: 243154
2015-07-24 20:33:22 +00:00
Michael Kruse d3059f3853 Compile fix; add missing ISL files
The last ISL update added two files that we must also add to Polly. 

llvm-svn: 243142
2015-07-24 19:09:27 +00:00
Tobias Grosser 566060d76f Update isl to isl-0.15-86-g595055e
Besides a couple of cleanups and refactorings in isl, this change set fixes a
couple of bugs in isl, that can cause issues during code generation.

llvm-svn: 243110
2015-07-24 13:12:17 +00:00
Michael Kruse 5e9f249c3e Add LICM test cases
These test cases check whether Polly still gives the same results if
LICM runs before.  Currently, it does not and therefore these cases are
expected fails. 

llvm-svn: 243037
2015-07-23 20:05:11 +00:00
Michael Kruse 75b6b0c5bd Always execute polly::CodePreparation before Polly
ScopDetection does not allow scops to begin with the entry block, were
allocas are added at code generation.

llvm-svn: 243036
2015-07-23 20:00:20 +00:00
Johannes Doerfert 338b42c329 Removed redundant alias checks generated during run time.
As specified in PR23888, run-time alias check generation is expensive
  in terms of compile-time. This reduces the compile time by computing
  minimal/maximal access only once for each base pointer

Contributed-by: Pratik Bhatu <cs12b1010@iith.ac.in>
llvm-svn: 243024
2015-07-23 17:04:54 +00:00
Tobias Grosser 6d32f8fbba isl: Translate brisebarre to use UNIX line endings
A similar patch will be upstreamed to ISL. We commit this ahead of time to
unblock people that are annoyed the permanent diffs we see in git.

llvm-svn: 243020
2015-07-23 15:35:45 +00:00
Chandler Carruth e677f7217b [PM/AA] Update to reflect the new LLVM API which no longer requires an
AliasAnalysis pointer.

llvm-svn: 242897
2015-07-22 12:15:33 +00:00
Michael Kruse bc776a7069 Update ISL to isl-0.15-61-gcea776f
The motivation is to fix a wrong use of the inline qualifier. This
fixes the Polly build using Visual Studio 2015 RC.

llvm-svn: 242780
2015-07-21 12:56:36 +00:00
Michael Kruse 6362f5aa0b Unify FOLDER property of Polly targets
Put all Polly targets into a single "Polly" category (i.e.
solution folder). Previously there was no recognizable scheme and most
categories contained just one or two targets or targets didn't belong
to any category.

Reviewers: grosser
llvm-svn: 242779
2015-07-21 12:40:01 +00:00
Michael Kruse 9e0db1d2e8 Remove header project from Visual Studio builds
Remove the polly_headers_do_not_build project. Visual Studio is capable
of finding the headers itself, although they are not listed explicitly.
For explicit listing, the headers should be added to the relevant
target.

Reviewers: grosser
llvm-svn: 242777
2015-07-21 12:33:15 +00:00
Michael Kruse c4ad882daf Remove module LLVMPolly from Windows build
Loadable modules are not supported on Windows.

Reviewers: grosser
llvm-svn: 242776
2015-07-21 12:29:02 +00:00
Michael Kruse 441357dca2 Remove gcc-specific flags from Visual Studio build
Remove the flags -fno-exceptions -fno-rtti and add the equivalent for
compiling with MSVC.

Reviewers: grosser
llvm-svn: 242775
2015-07-21 12:22:36 +00:00
Michael Kruse 99f2db166b Remove /Za flag from Visual Studio compilation
According to Stephan T. Lavavej it is broken. See
http://comments.gmane.org/gmane.comp.compilers.clang.devel/21638

Reviewers: grosser
llvm-svn: 242773
2015-07-21 12:16:00 +00:00
Michael Kruse 9e44f2f1cc Add a test for stdint.h like ISL's configure does
Reviewers: grosser
llvm-svn: 242772
2015-07-21 12:09:41 +00:00
Michael Kruse d2bb9a3a31 Remove gitconfig.h.cmake
It is just one line which can be better generated in the CMakeLists.txt
itself, just as ISL's configure does.

Reviewers: grosser
llvm-svn: 242771
2015-07-21 12:06:27 +00:00
Michael Kruse bf5a711e96 Add configure-time test for latest ISL
Query the isl_config.h macros recently added to ISL. One of it looks for
the ffs (find first set), whose functionality is available in Visual
Studio with _BitScanForward. Also add isl_ffs.c to the source files
which contains the implementation of ffs using _BitScanForward.

Reviewers: grosser
llvm-svn: 242770
2015-07-21 12:01:14 +00:00
Tobias Grosser 495124c4d6 GPURuntimeDebugPrinter: Printer pointer values (except if they are strings)
Only pointer values in constant address space are assumed to be strings. For
all other pointers their address is printed.

llvm-svn: 242524
2015-07-17 13:57:57 +00:00
Tobias Grosser d783a98303 Add option to choose where in the pass pipeline polly is run
These options are useful to play with the location of Polly within LLVM's
pass manager.

llvm-svn: 242390
2015-07-16 08:28:09 +00:00
Tobias Grosser 469609a714 Mark a couple of items as completed
llvm-svn: 242136
2015-07-14 10:52:58 +00:00
Tobias Grosser c268835eca Drop outdated video
llvm-svn: 242135
2015-07-14 10:45:03 +00:00
Tobias Grosser 0241bd2c7e www: Add link to llvm.org
llvm-svn: 242134
2015-07-14 10:44:06 +00:00
Tobias Grosser 808cd69a92 Use schedule trees to represent execution order of statements
Instead of flat schedules, we now use so-called schedule trees to represent the
execution order of the statements in a SCoP. Schedule trees make it a lot easier
to analyze, understand and modify properties of a schedule, as specific nodes
in the tree can be choosen and possibly replaced.

This patch does not yet fully move our DependenceInfo pass to schedule trees,
as some additional performance analysis is needed here. (In general schedule
trees should be faster in compile-time, as the more structured representation
is generally easier to analyze and work with). We also can not yet perform the
reduction analysis on schedule trees.

For more information regarding schedule trees, please see Section 6 of
https://lirias.kuleuven.be/handle/123456789/497238

llvm-svn: 242130
2015-07-14 09:33:13 +00:00
Tobias Grosser 16c4403a91 Make non-affine statement names isl compatible
Named isl sets can generally have any name if they remain within Polly, but only
certain strings can be parsed by isl. The new names we create ensure that we
can always copy-past isl strings from Polly to other isl tools, e.g. for
debugging.

llvm-svn: 241787
2015-07-09 07:31:45 +00:00