Commit Graph

118 Commits

Author SHA1 Message Date
Tobias Grosser 9691d23d37 Dependences: Prettify the header slightly
llvm-svn: 152236
2012-03-07 17:42:39 +00:00
Tobias Grosser 1d8c0d799c Dependences: Remove unused no_source information
llvm-svn: 152235
2012-03-07 17:42:36 +00:00
Tobias Grosser 5c0e7190ff Dependences: Simplify the check if a new scattering is valid.
We now just check if the new scattering would create non-positive dependences.
This is a lot faster than recalculating dependences (which is especially slow
on tiled code).

llvm-svn: 152230
2012-03-07 16:10:40 +00:00
Tobias Grosser 5f9a762056 ScopInfo: Add Scop::getDomains()
llvm-svn: 150482
2012-02-14 14:02:40 +00:00
Tobias Grosser cef36d5b99 Copy IndVarSimplify pass from LLVM to Polly
This allows us to enable -enable-iv-rewrite by default and releases LLVM from
the burdon to keep that feature. This is an intermediate step. We plan to soon
remove the need for rewritten induction variables entirely.

llvm-svn: 150481
2012-02-14 14:02:33 +00:00
Tobias Grosser 1d348673e0 Add a sceleton for a polyhedral dead code elimination.
Such a dead code elimination can remove redundant stores to arrays. It can also
eliminate calculations where the results are stored to memory but where they are
overwritten before ever being read. It may also fix bugs like:
http://llvm.org/bugs/show_bug.cgi?id=5117

This commit just adds a sceleton without any functionality.

If anybody is interested to learn about polyhedral optimizations this would be
a good task. Well definined, self contained and pretty simple. Ping me if you
want to start and you need some pointers to get going.

llvm-svn: 149386
2012-01-31 14:00:27 +00:00
Tobias Grosser a132155bd8 RegisterPass: Expose functions to register Polly passes
llvm-svn: 149240
2012-01-30 09:07:50 +00:00
Tobias Grosser 28dd48613e ScopInfo: Add isStrideX to unify stride checking
llvm-svn: 148810
2012-01-24 16:42:16 +00:00
Tobias Grosser 78d8a3d505 ScopInfo: Simplify some code
llvm-svn: 148326
2012-01-17 20:34:23 +00:00
Tobias Grosser a187964bac Support non-affine access functions in Polly.
In case we can not analyze an access function, we do not discard the SCoP, but
assume conservatively that all memory accesses that can be derived from our base
pointer may be accessed.

Patch provided by: Marcello Maggioni <hayarms@gmail.com>

llvm-svn: 146972
2011-12-20 10:43:14 +00:00
Tobias Grosser ff9b54d5a9 JScop: Allow to update the context
llvm-svn: 144639
2011-11-15 11:38:44 +00:00
Tobias Grosser ecf6cd06f0 Make JScop export/reimport accessible from clang
llvm-svn: 144638
2011-11-15 11:38:36 +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 9759f85060 Use getBasePtr in TempScop/ScopInfo
llvm-svn: 144279
2011-11-10 12:44:55 +00:00
Tobias Grosser 19632d7814 Remove unused function declaration
llvm-svn: 144233
2011-11-09 22:35:19 +00:00
Tobias Grosser f50fc50c80 Remove unused parameters from TempScop
llvm-svn: 144232
2011-11-09 22:35:15 +00:00
Tobias Grosser e4e2f7b16e TempScop: Rename SCEVAffFunc to IRAccess
The SCEVAffFunc is now only used to express memory accesses. Give it a proper
name and rework the class such that this is obvious.

llvm-svn: 144231
2011-11-09 22:35:09 +00:00
Tobias Grosser 499f0a48d8 Further remove now invalid SCEVAffFunc features.
This also removes the construction of MayAliasSets that became invalid when
removing the use of SCEVAffFunc.

llvm-svn: 144230
2011-11-09 22:35:05 +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 f317e3ac83 Do not check memory accesses additionally with isValidAffineFunction
This check was necessary because of the use AffineSCEVIterator in TempScopInfo.
As we removed this use recently it is not necessary any more.

llvm-svn: 144228
2011-11-09 22:34:53 +00:00
Tobias Grosser 866b8ae928 Remove more unused stuff from SCEVAffFunc
llvm-svn: 144227
2011-11-09 22:34:48 +00:00
Tobias Grosser a601fbd682 Remove SCEVAffFunc from polly::Comparison
llvm-svn: 144226
2011-11-09 22:34:44 +00:00
Tobias Grosser 5683df4a23 Remove more of SCEVAffineFunc
llvm-svn: 144223
2011-11-09 22:34:34 +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 65b0058b56 Remove const
llvm-svn: 144086
2011-11-08 15:41:19 +00:00
Tobias Grosser 6be480c4ab ScopInfo: Don't add common parameters during realignment to the context.
Previously we built a context that contained already all parameter dimensions
from the start. We now build a context without any parameter dimensions and
extend the context as needed. All parameter dimensions are added during final
realignment.

llvm-svn: 144085
2011-11-08 15:41:13 +00:00
Tobias Grosser 8cae72f186 ScopInfo: Realign parameters after the scop is built
llvm-svn: 144084
2011-11-08 15:41:08 +00:00
Tobias Grosser 9a38ab8a04 Use a map to store the dimension of the the parameters
llvm-svn: 144083
2011-11-08 15:41:03 +00:00
Tobias Grosser 76c2e32a8e ScopInfo: Extract function getIdForParam()
llvm-svn: 143961
2011-11-07 12:58:59 +00:00
Tobias Grosser 120db6b583 SCEVValidator: Move into own file
llvm-svn: 143960
2011-11-07 12:58:54 +00:00
Tobias Grosser 2392805094 TempScop: Remove unused SCEVAffFunc constructor
llvm-svn: 143652
2011-11-03 21:03:10 +00:00
Tobias Grosser 56f4745c3f TempScop: Remove has_signed (was unused)
llvm-svn: 143651
2011-11-03 21:03:06 +00:00
Tobias Grosser 1179afafca TempScop: Remove SCEVAffFunc from LoopBoundInfo
This is not needed anymore -> Reduce impact of SCEVAffFunc.

llvm-svn: 143575
2011-11-02 21:37:51 +00:00
Tobias Grosser 967239c029 Only have a single option to disable tiling for both isl and Pocc optimzer
This also documents the new option on the website.

llvm-svn: 142775
2011-10-23 20:59:44 +00:00
Tobias Grosser 67707b7131 Enable prevectorization with -enable-polly-vector.
This removes the separate prevector options for the Pluto and isl scheduler.

llvm-svn: 142774
2011-10-23 20:59:40 +00:00
Tobias Grosser 70c31f9411 ScopLib: Fix memory issues
llvm-svn: 142769
2011-10-23 20:59:24 +00:00
Tobias Grosser 048c87943c ScopInfo: Remove unneeded code
llvm-svn: 142768
2011-10-23 20:59:20 +00:00
Tobias Grosser 4f129a6b43 Show the reason a region is not a SCoP in the DOT graphs.
llvm-svn: 141458
2011-10-08 00:30:55 +00:00
Tobias Grosser c4a0bd13ad ScopDetection: Unify the handling of invalid SCoPs
llvm-svn: 141457
2011-10-08 00:30:48 +00:00
Tobias Grosser 73600b8edd Initialize the passes early and properly.
llvm-svn: 141455
2011-10-08 00:30:40 +00:00
Tobias Grosser e19661e0ca ScopInfo: Some cleanups
- Use __isl_give and __isl_take
- Convert variables to start with Uppercase letter
- Only assign the 'domain' after it is fully constructed
- Only name it after it is fully constructed

llvm-svn: 141361
2011-10-07 08:46:57 +00:00
Tobias Grosser 9b13d3dbe5 ScopInfo: Simplify the construction of the iteration domain.
llvm-svn: 141325
2011-10-06 22:32:58 +00:00
Tobias Grosser 5d45381294 ScopInfo: Only give away a copy of the access relation.
Also take the chance and rename access functions to access relations. This is
because we do not only allow plain functions to describe an access, but we
can have any access relation that can be described with linear constraints.

llvm-svn: 141257
2011-10-06 00:04:11 +00:00
Tobias Grosser cf3942dfa6 ScopInfo: Only give away a copy of the schedule.
llvm-svn: 141256
2011-10-06 00:04:05 +00:00
Tobias Grosser 4da8d9fc15 ScopInfo: Only give away a copy of the Context
llvm-svn: 141255
2011-10-06 00:03:59 +00:00
Tobias Grosser 3c69fab0e8 ScopInfo: Get the isl_ctx always with getIslCtx()
llvm-svn: 141254
2011-10-06 00:03:54 +00:00
Tobias Grosser 0e27e24751 ScopInfo: Use separate function to build context
llvm-svn: 141253
2011-10-06 00:03:48 +00:00
Tobias Grosser 3748705fff Export the parameter space directly from the SCoP.
Use this to simplify some code.

llvm-svn: 141252
2011-10-06 00:03:42 +00:00
Tobias Grosser f53388034d Adapt to introduction of isl_space
Polly should now be compiled with CLooG 0c252c88946b27b7b61a1a8d8fd7f94d2461dbfd
and isl 56b7d238929980e62218525b4b3be121af386edf. The most convenient way to
update is utils/checkout_cloog.sh.

llvm-svn: 141251
2011-10-06 00:03:35 +00:00
Tobias Grosser 83f5c43ede Add some forgotten passes to LinkAllPasses
llvm-svn: 138400
2011-08-23 22:35:08 +00:00
Tobias Grosser 604c981f40 Temporarily remove reduction support and interchange pass
I am planning to eliminate the TempScopInfo pass. To simplify this I remove
some features that may later be added to the ScopInfo pass.

The interchange pass is currently strongly tested and furthermore ment to be
replaced by the general scheduling optimizer. Reductions itself can later
be added easily.

llvm-svn: 138219
2011-08-21 14:57:58 +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 edd8372d4f TempSCoP: Store SCEV a SCEVAffFunc was derived from
llvm-svn: 137928
2011-08-18 06:31:43 +00:00
Raghesh Aloor 62b13120ee Memaccess: Codegeneration for a simple access function change
Code is generated for a simple access function change imported
from JSCOP file. An access of A[i] is changed to A[0]. The code
for A[0] is generated directly without refering to isl function calls.

llvm-svn: 136789
2011-08-03 17:02:50 +00:00
Tobias Grosser 55927aa400 Use llvm::*Type without const
llvm-svn: 135384
2011-07-18 09:53:32 +00:00
Raghesh Aloor 3cb6628d7c MemAccess: Reading Change in Access Function
This patch reads the change in access functions from
imported JSCOP file. A test case is also added.

llvm-svn: 134991
2011-07-12 17:14:03 +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 2aec339d28 Cloog: Export clast_root
llvm-svn: 131357
2011-05-14 19:02:29 +00:00
Tobias Grosser e91c53d2a9 CodeGeneration: No need to forget SCoP.
As we do not delete the SCoP, there is no need to remove it from the SCoP
detection.

llvm-svn: 131356
2011-05-14 19:02:21 +00:00
Tobias Grosser 30aa24cd6b ScheduleOptimizer: Add an isl based schedule optimizer
The isl based routines implement a new interpretation of the Pluto algorithm
new interpretation. This patch requires a recent version of isl to be installed.

llvm-svn: 131354
2011-05-14 19:02:06 +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 a806606aaa ScopDetection: Move implementation of function from header to .cpp file
llvm-svn: 131246
2011-05-12 21:33:28 +00:00
Tobias Grosser d5a7bfc51d ScopInfo: Do not return reference to member variable 'domain'.
Instead of returning a pointer to the domain, we return a new copy of it. This
is safer, as we do not give access to internal objects. It is also not
expensive, as isl will just increment a reference counter.

llvm-svn: 131010
2011-05-06 19:52:19 +00:00
Tobias Grosser 69f8514cb7 Dependences: Add interface to retrieve dependences.
llvm-svn: 131009
2011-05-06 19:52:09 +00:00
Hongbin Zheng 94c5df16e2 ScopDetection: Remember the functions generated by backend in a pointer set, so we
do not re-generate code for these functions.

llvm-svn: 130975
2011-05-06 02:38:20 +00:00
Hongbin Zheng dbdebe28de Refactor: Move 'isParallelFor' from codegen backend to Dependences analysis, so other passes can also use it.
llvm-svn: 130752
2011-05-03 13:46:58 +00:00
Hongbin Zheng 27f3afbc1a ScopInfo: Rememeber the induction variable and its parent loop at the same thime.
llvm-svn: 130586
2011-04-30 03:26:51 +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