Commit Graph

37 Commits

Author SHA1 Message Date
Tobias Grosser 3e030e178a Correctly convert APInt to gmp values
Previously this happend to work for integers up to i64, but we got it wrong
for larger numbers. Fix this and add test cases to verify this keeps working.

Reported by: Sven Verdoolaege <skimo at kotnet dot org>

llvm-svn: 183986
2013-06-14 16:23:38 +00:00
Tobias Grosser 83628182f7 Sort includes
llvm-svn: 181297
2013-05-07 08:11:54 +00:00
Tobias Grosser e602a07662 Reformat with clang-format
clang-format become way more stable. This time we mainly reformat function
signatures.

llvm-svn: 181294
2013-05-07 07:30:56 +00:00
Tobias Grosser 8edce4ee62 Support SCoPs with multiple entry edges.
Regions that have multiple entry edges are very common. A simple if condition
yields e.g. such a region:

  if
 /   \
then  else
 \   /
for_region

This for_region contains two entry edges 'then' -> 'for_region' and 'else' -> 'for_region'.

Previously we scheduled the RegionSimplify pass to translate such regions into
simple regions. With this patch, we now support them natively when the region is
in -loop-simplify form, which means the entry block should not be a loop header.

Contributed by:  Star Tan <tanmx_star@yeah.net>

llvm-svn: 179586
2013-04-16 08:04:42 +00:00
Tobias Grosser 3ed2600cab SCEVValidator: Correctly store 'k * p' as a parameter
We do not only need to understand that 'k * p' is a parameter expression, but
also need to store this expression in the set of parameters. Before this patch
we wrongly stored the two individual parameters %k and %p.

Reported by: Sebastian Pop <spop@codeaurora.org>

llvm-svn: 179485
2013-04-14 13:15:59 +00:00
Tobias Grosser ecb5092707 ScopDetect: Allow multiplications of the form <param> * <param>
We handle these by treating this result of the multiplication as an additional
parameter.

llvm-svn: 179163
2013-04-10 07:42:28 +00:00
Tobias Grosser 4d96c8d714 clang-format: Many more files
After this commit, polly is clang-format clean. This can be tested with
'ninja polly-check-format'. Updates to clang-format may change this, but the
differences will hopefully be both small and general improvements to the
formatting.

We currently have some not very nice formatting for a couple of items, DEBUG()
stmts for example. I believe the benefit of being clang-format clean outweights
the not perfect layout of this code.

llvm-svn: 177796
2013-03-23 01:05:07 +00:00
Tobias Grosser ecfe21b792 Remove dependence on canonical induction variable
When using the scev based code generation, we now do not rely on the presence
of a canonical induction variable any more. This commit prepares the path to
(conditionally) disable the induction variable canonicalization pass.

llvm-svn: 177548
2013-03-20 18:03:18 +00:00
Sebastian Pop 97cb813c29 Correct function to decide if a SCEV can be ignored
When doing SCEV based code generation, we ignore instructions calculating values
that are fully defined by a SCEV expression. The values that are calculated by
this instructions are recalculated on demand.

This commit improves the check to verify if certain instructions can be ignored
and recalculated on demand.

llvm-svn: 177313
2013-03-18 20:21:13 +00:00
Tobias Grosser 0d1cf2b875 ScopHelper: Remove some dead code
llvm-svn: 177307
2013-03-18 19:17:07 +00:00
Tobias Grosser de49b8fa3b Support: clang-format
llvm-svn: 175874
2013-02-22 08:21:52 +00:00
Tobias Grosser d535f55146 Formatting fixes
llvm-svn: 175177
2013-02-14 16:42:45 +00:00
Tobias Grosser 7a2f39534f 'chmod -x' on files that do not need the executable bits
llvm-svn: 171224
2012-12-29 15:09:03 +00:00
Tobias Grosser eeb776a41f SCEVValidator: Add debug output that gives the reason for invalid expressions
llvm-svn: 163472
2012-09-08 14:00:37 +00:00
Tobias Grosser 6eaafb7288 Remove dead code
This code has been replaced by the SCEVValidator a while ago.

llvm-svn: 163471
2012-09-08 14:00:32 +00:00
Hongbin Zheng 454e8f9ee8 Add stringFromIslObj support for various isl_objs.
Patched by JunQi<dengjunqi06323011@hotmail.com>.

llvm-svn: 159735
2012-07-05 08:55:31 +00:00
Hongbin Zheng 5205e0c40e Refactor: Use generic internal function template in GICHelper.cpp to avoid duplication.
llvm-svn: 159734
2012-07-05 08:42:39 +00:00
Tobias Grosser f9fbbdfd74 Fix typos.
Pointed out by: Sebastian Pop  <sebpop@gmail.com>

llvm-svn: 154337
2012-04-09 19:46:05 +00:00
Tobias Grosser 3ec2abc5fb Don't allow pointer types in affine expressions
We currently do not support pointer types in affine expressions. Hence, we
disallow in the SCoP detection. Later we may decide to add support for them.

This fixes PR12277

Reported-By: Sebastian Pop  <sebpop@gmail.com>
llvm-svn: 152928
2012-03-16 16:36:47 +00:00
Tobias Grosser 371badaa47 SCEVValidator: Ensure that parameters are recorded correctly
This also fixes UMax where we did not correctly keep track of the parameters.
Fixes PR12275.

Reported-By: Sebastian Pop  <sebpop@gmail.com>
llvm-svn: 152913
2012-03-16 10:16:28 +00:00
Tobias Grosser 540757b09c ScevValidator: Add printer for ValidatorResult
llvm-svn: 152912
2012-03-16 10:12:37 +00:00
Benjamin Kramer 66af99eb34 Update after LLVM API change.
llvm-svn: 146279
2011-12-09 21:34:43 +00:00
Tobias Grosser edb8a2807a SCEVValidator: Fix coding standards in ValidatorResult
llvm-svn: 144907
2011-11-17 12:56:21 +00:00
Tobias Grosser fa043f00cd SCEVValidator: Make ValidatorResult a class and enforce the use of wproper accessors
llvm-svn: 144906
2011-11-17 12:56:19 +00:00
Tobias Grosser b1f07c5c0b SCEVValidator: Document SCEVType and ValidatorResult
Suggested by Sebastian Pop.

llvm-svn: 144905
2011-11-17 12:56:17 +00:00
Tobias Grosser bcc0a0d560 SCEVValidator: Restructure the logic of visitAddRecExpr
Suggested by Sebastian Pop.

llvm-svn: 144904
2011-11-17 12:56:14 +00:00
Tobias Grosser 2a7cd94215 SCEVValidator: Fix typo
llvm-svn: 144903
2011-11-17 12:56:12 +00:00
Tobias Grosser 7ffe4e8b0b Fix placement of the '*' that marks a pointer
Suggested by Sebastian Pop.

llvm-svn: 144902
2011-11-17 12:56:10 +00:00
Tobias Grosser e5e171eadd Reuse the old BaseAddress checking in SCEVValidator to make sure that no base
address is part of the access function. Also remove unused special cases that
were necessery when the base address was still contained in the access function

llvm-svn: 144280
2011-11-10 12:45:03 +00:00
Tobias Grosser 6e9f25a5d5 Remove AffineSCEVIterator
We do not use it anymore. It was replaced by SCEVVisitors like the
SCEVValidator.

llvm-svn: 144229
2011-11-09 22:35:00 +00:00
Tobias Grosser 60b54f19e6 Detect Parameters directly on the SCEV.
Instead of using TempScop to find parameters, we detect them directly
on the SCEV. This allows us to remove the TempScop parameter detection
in a subsequent commit.

This fixes a bug reported by Marcello Maggioni <hayarms@gmail.com>

llvm-svn: 144087
2011-11-08 15:41:28 +00:00
Tobias Grosser 120db6b583 SCEVValidator: Move into own file
llvm-svn: 143960
2011-11-07 12:58:54 +00:00
Tobias Grosser b76f385334 Free isl_ctx and fix several memory leaks
Because of me not understanding the LLVM pass structure well, I did not find a
good way to allocate isl_ctx and to free it later without getting issues with
reference counting. I now found this place, such that we can free isl_ctx. This
patch also fixes the memory leaks that were ignored beforehand.

llvm-svn: 138204
2011-08-20 11:11:25 +00:00
Tobias Grosser 15f5efff8f GICHelper: Fix memory leaks, as we forgot to free some strings.
llvm-svn: 138203
2011-08-20 11:11:18 +00:00
Tobias Grosser de68cc91cf ScheduleOpt: Use band forest to get the schedules
isl introduced a new representation for the schedules it calculates. The new
representation uses a forest of bands and is closer to the structure of the
data as the old interface. Switch to the new interface, as it is nicer to use
and as the old interface will soon be removed from isl.

WARNING: This commit needs a version of isl that is more recent that the one
         included in CLooG. See:
	 http://polly.grosser.es/get_started.html#islTrunk
llvm-svn: 134181
2011-06-30 20:01:02 +00:00
Tobias Grosser 8c4cfc327b CodeGeneration: Do not delete the old version of the Scop.
Instead of deleting the old code, keep it on the side in an if-branch. It will
either be deleted by the dead code elimination or we can use it as fallback.

llvm-svn: 131352
2011-05-14 19:01:49 +00:00
Tobias Grosser 758053788b Add initial version of Polly
This version is equivalent to commit ba26ebece8f5be84e9bd6315611d412af797147e
in the old git repository.

llvm-svn: 130476
2011-04-29 06:27:02 +00:00