Commit Graph

2409 Commits

Author SHA1 Message Date
Michael Kruse e73bf3cfff [ScopInfo] Remove unused typedef OutgoingValueMapTy. NFC.
llvm-svn: 270439
2016-05-23 14:51:52 +00:00
Michael Kruse 1007182cf7 [ScopInfo] Change removeMemoryAccesses to remove only one access. NFC.
This exposes the more basic operation for use by code not related to
invariant code hoisting.

llvm-svn: 270438
2016-05-23 14:45:58 +00:00
Michael Kruse 996fb611b3 Remove some unused local variables. NFC.
Found by clang static analyzer (http://llvm.org/reports/scan-build/)
and Visual Studio.

llvm-svn: 270432
2016-05-23 13:00:41 +00:00
Johannes Doerfert 0f0d209bec Use the SCoP directly for canSynthesize [NFC]
llvm-svn: 270429
2016-05-23 12:47:09 +00:00
Johannes Doerfert 57a7317fb8 Simplify ScopInfo function interfaces [NFC]
llvm-svn: 270428
2016-05-23 12:45:17 +00:00
Johannes Doerfert e0b08077bf Allow to check for dominance wrt. a SCoP [NFC]
llvm-svn: 270427
2016-05-23 12:43:44 +00:00
Johannes Doerfert ef74443c97 Duplicate part of the Region interface in the Scop class [NFC]
This allows to use the SCoP directly for various queries,
  thus to hide the underlying region more often.

llvm-svn: 270426
2016-05-23 12:42:38 +00:00
Johannes Doerfert 952b5304bc Add and use Scop::contains(Loop/BasicBlock/Instruction) [NFC]
llvm-svn: 270424
2016-05-23 12:40:48 +00:00
Johannes Doerfert 3f52e35471 Directly access information through the Scop class [NFC]
llvm-svn: 270421
2016-05-23 12:38:05 +00:00
Johannes Doerfert c553ce50fa Add missing doxygen comments [NFC]
llvm-svn: 270420
2016-05-23 12:36:44 +00:00
Johannes Doerfert 25227fe7b0 Optimistic assume required invariant loads to be invariant
Before this patch we bailed if a required invariant load was potentially
  overwritten. However, now we will optimistically assume it is actually
  invariant and, to this end, restrict the valid parameter space as well as the
  execution context with regards to potential overwrites of the location.

llvm-svn: 270416
2016-05-23 10:40:54 +00:00
Johannes Doerfert 764b7e66f0 [FIX] Require base pointers of loads that might alias to be hoisted
Since the base pointer of a possibly aliasing pointer might not alias
  with any other pointer it (the base pointer) might not be tagged as
  "required invariant". However, we need it do be in order to compare
  the accessed addresses of the derived (possibly aliasing) pointer.

  This patch also tries to clean up the load hoisting a little bit.

llvm-svn: 270412
2016-05-23 09:26:46 +00:00
Johannes Doerfert 38a012c46b Simplify BlockGenerator::handleOutsideUsers interface [NFC]
llvm-svn: 270411
2016-05-23 09:14:07 +00:00
Johannes Doerfert 1dafea4114 Make the detection context non-constant [NFC]
llvm-svn: 270410
2016-05-23 09:07:08 +00:00
Johannes Doerfert a61eda7698 [FIX] Let ScalarEvolution forget hoisted values
We have to rethink the handling of escaping values in order to make
  this kind of "fixes" go away.

llvm-svn: 270409
2016-05-23 09:02:54 +00:00
Johannes Doerfert 1a4ad8f771 [FIX] Synthezise Sdiv/Srem/Udiv instructions correctly.
This patch simplifies the Sdiv/Srem/Udiv expansion and thereby
  prevents errors, e.g., regarding the insertion point.

llvm-svn: 270408
2016-05-23 08:55:43 +00:00
Johannes Doerfert cda1bd5048 Revert "Optimistic assume required invariant loads to be invariant"
This reverts commit 787e642207ca978f2e800140529fc7049ea1f3de until the
lnt failures are fixed.

llvm-svn: 270061
2016-05-19 13:47:34 +00:00
Johannes Doerfert cb77542d1c Optimistic assume required invariant loads to be invariant
So far we bailed if a required invariant load was potentially overwritten in
  the SCoP. From now on we will optimistically assume it is actually invariant
  and, to this end, restrict the valid parameter space.

llvm-svn: 270060
2016-05-19 13:24:10 +00:00
Johannes Doerfert 469db6a247 Move internal enum out of class declaration [NFC]
llvm-svn: 270054
2016-05-19 12:36:43 +00:00
Johannes Doerfert ffd222f2d6 Propagate the DetectionContext to the SCoP [NFC]
The SCoP now holds a reference to the ScopDetection::DetectionContext
  which allows to simplify the type of various methods and remove code.

llvm-svn: 270053
2016-05-19 12:34:57 +00:00
Johannes Doerfert 60dd9e1346 Compute the MaxLoopDepth during domain construction [NFC]
llvm-svn: 270052
2016-05-19 12:33:14 +00:00
Johannes Doerfert f5841a66af Remove leftover debug output [NFC]
llvm-svn: 270051
2016-05-19 12:32:54 +00:00
Johannes Doerfert 6dc3616195 Remove unsused methodes [NFC]
llvm-svn: 270050
2016-05-19 12:31:16 +00:00
Tobias Grosser 0a828aa000 docs: Remove reference to PoCC
Since several releases we do not ship any more with PoCC.

llvm-svn: 269809
2016-05-17 19:44:16 +00:00
Tobias Grosser 35b544adc5 docs: Do not suggest the user to ignore aliasing
Since a long time Polly can automatically generate run-time alias checks.

llvm-svn: 269806
2016-05-17 19:42:19 +00:00
Tobias Grosser 97afc45b08 docs: Fix code-block to avoid sphinx error
llvm-svn: 269763
2016-05-17 13:41:00 +00:00
Johannes Doerfert e6e3c9246a Check late for profitability
Before this patch we only expanded valid __and__ profitable region. Therefor
  we did not allow the expansion to create a profitable region from a
  non-profitable one.  With this patch we will remember and expand all valid
  regions and check for profitability only at the end.

  This patch increases the number of valid SCoPs in the LLVM-TS and SPEC
  2000/2006 by 28% (from 303 to 390), including the hot loop in hmmer.

llvm-svn: 269343
2016-05-12 20:21:50 +00:00
Johannes Doerfert 6c7639b380 Cleanup rejection log handling [NFC]
This patch cleans up the rejection log handling during the
  ScopDetection. It consists of two interconnected parts:
    - We keep all detection contexts for a function in order to provide
      more information to the user, e.g., about the rejection of
      extended/intermediate regions.
    - We remove the mutable "RejectLogs" member as the information is
      available through the detection contexts.

llvm-svn: 269323
2016-05-12 18:50:01 +00:00
Johannes Doerfert 5c2b556b13 Bring some comments up to date [NFC]
llvm-svn: 269301
2016-05-12 15:15:50 +00:00
Johannes Doerfert 6f1bb7a9d9 Support truncate operations
Truncate operations are basically modulo operations, thus we can model
  them that way. However, for large types we assume the operand to fit
  in the new type size instead of introducing a modulo with a very large
  constant.

llvm-svn: 269300
2016-05-12 15:13:49 +00:00
Johannes Doerfert 404a0f81ea Check overflows in RTCs and bail accordingly
We utilize assumptions on the input to model IR in polyhedral world.
  To verify these assumptions we version the code and guard it with a
  runtime-check (RTC). However, since the RTCs are themselves generated
  from the polyhedral representation we generate them under the same
  assumptions that they should verify. In other words, the guarantees
  that we try to provide with the RTCs do not hold for the RTCs
  themselves. To this end it is necessary to employ a different check
  for the RTCs that will verify the assumptions did hold for them too.

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

llvm-svn: 269299
2016-05-12 15:12:43 +00:00
Johannes Doerfert 27d12d3d1f Invalidate unprofitable SCoPs after creation
If a profitable run is performed we will check if the SCoP seems to be
  profitable after creation but before e.g., dependence are computed. This is
  needed as SCoP detection only approximates the actual SCoP representation.
  In the end this should allow us to be less conservative during the SCoP
  detection while keeping the compile time in check.

llvm-svn: 269074
2016-05-10 16:38:09 +00:00
Johannes Doerfert bf9473b2d8 Weaken profitability constraints during ScopDetection
Regions with one affine loop can be profitable if the loop is
  distributable. To this end we will allow them to be treated as
  profitable if they contain at least two non-trivial basic blocks.

llvm-svn: 269064
2016-05-10 14:42:30 +00:00
Johannes Doerfert ede4ecaefb [FIX] Cleanup isl objects prior to early exit
llvm-svn: 269061
2016-05-10 14:01:21 +00:00
Johannes Doerfert 2b92a0e4ee Handle llvm.assume inside the SCoP
The assumption attached to an llvm.assume in the SCoP needs to be
  combined with the domain of the surrounding statement but can
  nevertheless be used to refine the context.

  This fixes the problems mentioned in PR27067.

llvm-svn: 269060
2016-05-10 14:00:57 +00:00
Johannes Doerfert 297c720d15 Propagate complexity problems during domain generation [NFC]
This patches makes the propagation of complexity problems during
  domain generation consistent. Additionally, it makes it less likely to
  encounter ill-formed domains later, e.g., during schedule generation.

llvm-svn: 269055
2016-05-10 13:06:42 +00:00
Johannes Doerfert 14b1cf35b5 [FIX] Create error-restrictions late
Before this patch we generated error-restrictions only for
  error-blocks, thus blocks (or regions) containing a not represented
  function call. However, the same reasoning is needed if the invalid
  domain of a statement subsumes its actual domain. To this end we move
  the generation of error-restrictions after the propagation of the
  invalid domains. Consequently, error-statements are now defined more
  general as statements that are assumed to be not executed.
  Additionally, we do not record an empty domain for such statements but
  a nullptr instead. This allows to distinguish between error-statements
  and dead-statements.

llvm-svn: 269053
2016-05-10 12:42:26 +00:00
Johannes Doerfert 2640454d1c Refactor simplifySCoP [NFC]
Remove obsolete code and decrease the indention in the
  Scop::simplifySCoP() function.

llvm-svn: 269049
2016-05-10 12:19:47 +00:00
Johannes Doerfert a60ad845c0 Simplify the internal representation according to the context [NFC]
We now use context information to simplify the domains and access
  functions of the SCoP instead of just aligning them with the parameter
  space.

llvm-svn: 269048
2016-05-10 12:18:22 +00:00
Johannes Doerfert e243753a4d Simplify access relation for invariant loads early [NFC]
llvm-svn: 269046
2016-05-10 11:59:59 +00:00
Johannes Doerfert 5f173d414e Prevent complex access ranges with low number of pieces.
Previously we checked the number of pieces to decide whether or not a
  invariant load was to complex to be generated. However, there are
  cases when e.g., divisions cause the complexity to spike regardless of
  the number of pieces. To this end we now check the number of totally
  involved dimensions which will increase with the number of pieces but
  also the number of divisions.

llvm-svn: 269045
2016-05-10 11:46:57 +00:00
Johannes Doerfert 56b377644a Expose interpretAsUnsigned in the SCEVAffinator [NFC]
This exposes the functionality to interpret a SCEV, or better the
  piece-wise function created from the SCEV, as an unsigned value
  instead of a signed one.

llvm-svn: 269044
2016-05-10 11:45:46 +00:00
Tobias Grosser 1022ca5646 Codegen: Enable the detection of min/max expressions
Min/max expressions are easier to read and can in some cases also result in
more concise IR that is generated as the min/max --- when lowered to a
cmp+select pattern -- commonly has a simpler condition then the ternary
condition isl would normally generate.

llvm-svn: 268855
2016-05-07 08:03:44 +00:00
Tobias Grosser 7ec06a86c1 test: Use CHECK-NEXT to not miss instructions in test output
llvm-svn: 268854
2016-05-07 08:03:32 +00:00
Tobias Grosser 6b49f17764 Update isl to isl-0.17-5-g57dc5ff
This update fixes an assertion in the isl scheduler.

llvm-svn: 268853
2016-05-07 07:41:25 +00:00
Michael Kruse e0b34f366f Update to ISL 0.17.
This release includes sevaral improvments compared to the previous
version isl-0.16.1-145-g243bf7c (from the ISL 0.17 announcement):
- optionally combine SCCs incrementally in scheduler
- optionally maximize coincidence in scheduler
- optionally avoid loop coalescing in scheduler
- minor AST generator improvements
- improve support for expansions in schedule trees

llvm-svn: 268500
2016-05-04 14:41:36 +00:00
Michael Kruse f7a4a94d05 Typo: ToComplex -> TooComplex. NFC.
llvm-svn: 268224
2016-05-02 12:25:36 +00:00
Michael Kruse bc150127ae Rename Conjuncts -> Disjunctions. NFC.
The check for complexity compares the number of polyhedra in a set,
which are combined by disjunctions (union, "OR"),
not conjunctions (intersection, "AND").

llvm-svn: 268223
2016-05-02 12:25:18 +00:00
Michael Kruse 315aa3278e [ScheduleOptimizer] Add -polly-opt-outer-coincidence option.
Add a command line switch to set the
isl_options_set_schedule_outer_coincidence option. ISL then tries to
build schedules where the outer member of a band satisfies the
coincidence constraints.

In practice this allows loop skewing for more parallelism in inner
loops.

llvm-svn: 268222
2016-05-02 11:35:27 +00:00
Johannes Doerfert 90f5fed10b [WWW] Mark task as done and me as owner of some task
llvm-svn: 268221
2016-05-02 11:21:30 +00:00