Skip to content
  1. Jul 29, 2013
  2. Jul 28, 2013
  3. Jul 27, 2013
  4. Jul 24, 2013
  5. Jul 16, 2013
  6. Jul 13, 2013
  7. Jul 05, 2013
  8. Jun 29, 2013
  9. Jun 23, 2013
  10. Jun 14, 2013
    • Tobias Grosser's avatar
      Correctly convert APInt to gmp values · 3e030e17
      Tobias Grosser authored
      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
      3e030e17
  11. Jun 12, 2013
    • Sebastian Pop's avatar
      ScopDetect: check region entering edges are valid. · 9d63234a
      Sebastian Pop authored
      
      
      When a region header is part of a loop, then all entering edges of this region
      should not come from the loop but outside the region. Otherwise, the loop may be
      only partially part of the region, which would cause troubles in handling
      induction variables.
      
      Currently, we can only model induction variables that are either fully part of
      the scop (loop induction variable) or induction variables that are scop-
      invariant (parameter). A loop that is only partially part of the
      scop causes troubles, as there is no good way to handle the induction
      variable in the independent blocks pass.
      
      Contributed-by: default avatarStar Tan <tanmx_star@yeah.net>
      llvm-svn: 183800
      9d63234a
  12. Jun 03, 2013
  13. May 31, 2013
    • Tobias Grosser's avatar
      Test that independent block pass does not transform induction variables · 93324aef
      Tobias Grosser authored
      The original test case showed a problem with the independet blocks pass and
      we decided to XFAIL it for now. Unfortunately the failure is not detected if
      we build without asserts and the verification of the independent block pass
      is not run. This change tests now for the actual reason of the failure and
      should trigger even in a non asserts build. We did not yet solve the underlying
      bug, but this should at least make the test suite behavior consistent.
      
      llvm-svn: 183025
      93324aef
  14. May 30, 2013
  15. May 20, 2013
  16. May 18, 2013
  17. May 16, 2013
    • Tobias Grosser's avatar
      Update LoopInfo correctly · 3081b0f5
      Tobias Grosser authored
      
      
      When the Polly code generation was written we did not correctly update the
      LoopInfo data, but still claimed that the loop information is correct. This
      does not only lead to missed optimizations, but it can also cause
      miscompilations in case passes such as LoopSimplify are run after Polly.
      
      Reported-by: default avatarSergei Larin <slarin@codeaurora.org>
      llvm-svn: 181987
      3081b0f5
    • Tobias Grosser's avatar
      LoopGenerators: Construct loops such that they are already loop rotated · 5db6ffd7
      Tobias Grosser authored
                      BeforeBB
                         |
                         v
                      GuardBB
                      /      \
             __  PreHeaderBB  \
            /  \    /         |
         latch  HeaderBB      |
            \  /    \         /
             <       \       /
                      \     /
                      ExitBB
      
      This does not only remove the need for an explicit loop rotate pass, but it also
      gives us the possibility to skip the construction of the guard condition in case
      the loop is known to be executed at least once. We do not yet exploit this, but
      by implementing this analysis in the isl code generator we should be able to
      remove more guards than the generic loop rotate pass can.  Another point is that
      loop rotation can introduce additional PHI nodes, which may hide that a loop can
      be executed in parallel. This change avoids this complication and will make it
      easier to move the openmp code generation into a separate pass.
      
      llvm-svn: 181986
      5db6ffd7
  18. May 07, 2013
    • Tobias Grosser's avatar
      Move polly options into separate option category · 637bd631
      Tobias Grosser authored
      Use the new cl::OptionCategory support to move the Polly options into a separate
      option category. The aim is to hide most options and show by default only the
      options a user needs to influence '-O3 -polly'. The available options probably
      need some care, but here is the current status:
      
      Polly Options:
      Configure the polly loop optimizer
      
        -enable-polly-openmp              - Generate OpenMP parallel code
        -polly                            - Enable the polly optimizer (only at -O3)
        -polly-no-tiling                  - Disable tiling in the scheduler
        -polly-only-func=<function-name>  - Only run on a single function
        -polly-report                     - Print information about the activities
                                            of Polly
        -polly-vectorizer                 - Select the vectorization strategy
          =none                           -   No Vectorization
          =polly                          -   Polly internal vectorizer
          =unroll-only                    -   Only grouped unroll the vectorize
                                              candidate loops
          =bb                             -   The Basic Block vectorizer driven by
                                              Polly
      
      llvm-svn: 181295
      637bd631
  19. Apr 17, 2013
    • Tobias Grosser's avatar
      IndependentBlocks: We can only reconstruct PHI nodes that are within the ScoP · e8df5bd9
      Tobias Grosser authored
      In the classical (non -polly-codegen-scev) mode, we assume that we can always
      recreate PHI nodes during code generation. This is not true. We can only
      reconstruct them from the polyhedral information, in case the entire loop of the
      PHI node is part of the SCoP and consequently the PHI node was translated in
      the polyhedral description.
      
      llvm-svn: 179674
      e8df5bd9
    • Tobias Grosser's avatar
      Remove unneeded RegionSimplify pass. · b5f92892
      Tobias Grosser authored
      
      
      We now support regions with multiple entries and multiple exits natively.
      Regions are not needed to be simplified to single entry and single exit.
      
      We need to XFAIL two test cases as this change increases the scop coverage
      and uncoveres two failures in the independent blocks pass. The first failure
      will be fixed in a subsequent commit, the second one is in the non-default
      -polly-codegen-scev mode and still needs to be fixed.
      
      Contributed-by: default avatarStar Tan <tanmx_star@yeah.net>
      llvm-svn: 179673
      b5f92892
    • Tobias Grosser's avatar
      tests: Fix 'instruction does not dominate all its uses' error · 36a01b0a
      Tobias Grosser authored
      The LLVM-IR of this test case was apperently incorrect.
      
      llvm-svn: 179672
      36a01b0a
  20. Apr 16, 2013
    • Tobias Grosser's avatar
      Support SCoPs with multiple entry edges. · 8edce4ee
      Tobias Grosser authored
      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
      8edce4ee
  21. Apr 14, 2013
    • Tobias Grosser's avatar
      SCEVValidator: Correctly store 'k * p' as a parameter · 3ed2600c
      Tobias Grosser authored
      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
      3ed2600c
  22. Apr 11, 2013
  23. Apr 10, 2013
    • Sebastian Pop's avatar
      fix testcase · 10066142
      Sebastian Pop authored
      llvm-svn: 179183
      10066142
    • Tobias Grosser's avatar
      ScopDetect: Allow multiplications of the form <param> * <param> · ecb50927
      Tobias Grosser authored
      We handle these by treating this result of the multiplication as an additional
      parameter.
      
      llvm-svn: 179163
      ecb50927
    • Tobias Grosser's avatar
      Support SCoPs with multiple exit edges · 0ee50f6e
      Tobias Grosser authored
      
      
      Regions that have multiple exit edges are very common. A simple if condition
      yields e.g. such a region:
      
              if
            /   \
        then     else
            \   /
            after
      
      Region: if -> after
      
      This regions contains the bbs 'if', 'then', 'else', but not 'after'. It has
      two exit edges 'then' -> 'after' and 'else' -> 'after'.
      
      Previously we scheduled the RegionSimplify pass to translate such regions into
      simple regions. With this patch, we now support them natively.
      
      Contributed-by: default avatarStar Tan <tanmx_star@yeah.net>
      llvm-svn: 179159
      0ee50f6e
    • Sebastian Pop's avatar
      scop detection: properly instantiate SCEVs to the place where they are used · 9f57c5b6
      Sebastian Pop authored
      Fix inspired from c2d4a0627e95c34a819b9d4ffb4db62daa78dade.
      
          Given the following code
      
              for (i = 0; i < 10; i++) {
                ;
              }
      
          S:  A[i] = 0
      
          When translate the data reference A[i] in statement S using scev, we need to
          retrieve the scev of 'i' at the location of 'S'. If we do not do this the
          scev that we obtain will be expressed as {0,+,1}_for and will reference loop
          iterators that do not surround 'S'. What we really want is the scev to be
          instantiated to the value of 'i' after the loop. This value is {10}.
      
      This used to crash in:
      
          int loopDimension = getLoopDepth(Expr->getLoop());
      
          isl_aff *LAff = isl_aff_set_coefficient_si(
              isl_aff_zero_on_domain(LocalSpace), isl_dim_in, loopDimension, 1);
      
      (gdb) p Expr->dump()
      {8,+,8}<nw><%do.body>
      
      (gdb) p getLoopDepth(Expr->getLoop())
      $5 = 0
      
          isl_space *Space = isl_space_set_alloc(Ctx, 0, NbLoopSpaces);
          isl_local_space *LocalSpace = isl_local_space_from_space(Space);
      
      As we are trying to create a memory access in a stmt that is outside all loops,
      LocalSpace has 0 dimensions:
      
      (gdb) p NbLoopSpaces
      $12 = 0
      
      (gdb) p Statement.BB->dump()
      
      if.then:                                          ; preds = %do.end
        %0 = load float* %add.ptr, align 4
        store float %0, float* %q.1.reg2mem, align 4
        br label %if.end.single_exit
      
      and so the scev for %add.ptr should be taken at the place where it is used,
      i.e., it should be the value on the last iteration of the do.body loop, and not
      "{8,+,8}<nw><%do.body>".
      
      llvm-svn: 179148
      9f57c5b6
  24. Apr 08, 2013
  25. Mar 23, 2013
    • Tobias Grosser's avatar
      clang-format: Many more files · 4d96c8d7
      Tobias Grosser authored
      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
      4d96c8d7
    • Tobias Grosser's avatar
      codegen: properly instantiate SCEVs to the place where they are used · 369430ff
      Tobias Grosser authored
      Given the following code
      
          for (i = 0; i < 10; i++) {
            ;
          }
      
      S:  A[i] = 0
      
      When code generating S using scev based code generation, we need to retrieve
      the scev of 'i' at the location of 'S'. If we do not do this the scev that
      we obtain will be expressed as {0,+,1}_for and will reference loop iterators
      that do not surround 'S' and that we consequently do not know how to code
      generate. What we really want is the scev to be instantiated to the value of 'i'
      after the loop. This value is {10} and it can be code generated without
      troubles.
      
      llvm-svn: 177777
      369430ff
  26. Mar 21, 2013
Loading