Skip to content
  1. Sep 13, 2016
  2. Sep 12, 2016
    • Michael Kruse's avatar
      Remove -fvisibility=hidden and FORCE_STATIC. · e5e752a2
      Michael Kruse authored
      The flag -fvisibility=hidden flag was used for the integrated Integer
      Set Library (and PPCG) to keep their definitions local to Polly. The
      motivation was the be loaded into a DragonEgg-powered GCC, where GCC
      might itself use ISL for its Graphite extension. The symbols of Polly's
      ISL and GCC's ISL would clash.
      
      The DragonEgg project is not actively developed anymore, but Polly's
      unittests need to call ISL functions to set up a testing environment.
      Unfortunately, the -fvisibility=hidden flag means that the ISL symbols
      are not available to the gtest executable as it resides outside of
      libPolly when linked dynamically. Currently, CMake links a second copy
      of ISL into the unittests which leads to subtle bugs. What got observed
      is that two isl_ids for isl_id_none exist, one for each library
      instance. Because isl_id's are compared by address, isl_id_none could
      happen to be different from isl_id_none, depending on which library
      instance set the address and does the comparison.
      
      Also remove the FORCE_STATIC flag which was introduced to keep the ISL
      symbols visible inside the same libPolly shared object, even when build
      with BUILD_SHARED_LIBS.
      
      Differential Revision: https://reviews.llvm.org/D24460
      
      llvm-svn: 281242
      e5e752a2
    • Roman Gareev's avatar
      Store the size of the outermost dimension in case of newly created arrays that... · f5aff704
      Roman Gareev authored
      
      Store the size of the outermost dimension in case of newly created arrays that require memory allocation.
      
      We do not need the size of the outermost dimension in most cases, but if we
      allocate memory for newly created arrays, that size is needed.
      
      Reviewed-by: default avatarMichael Kruse <llvm@meinersbur.de>
      
      Differential Revision: https://reviews.llvm.org/D23991
      
      llvm-svn: 281234
      f5aff704
    • Tobias Grosser's avatar
      GPGPU: Bail out gracefully in case of invalid IR · 5857b701
      Tobias Grosser authored
      Instead of aborting, we now bail out gracefully in case the kernel IR we
      generate is invalid. This can currently happen in case the SCoP stores
      pointer values, which we model as arrays, as data values into other arrays. In
      this case, the original pointer value is not available on the device and can
      consequently not be stored. As detecting this ahead of time is not so easy, we
      detect these situations after the invalid IR has been generated and bail out.
      
      llvm-svn: 281193
      5857b701
  3. Sep 11, 2016
    • Tobias Grosser's avatar
      GPGPU: Do not fail in case of arrays never accessed · 02293ed7
      Tobias Grosser authored
      If these arrays have never been accessed we failed to derive an upper bound
      of the accesses and consequently a size for the outermost dimension. We
      now explicitly check for empty access sets and then just use zero as size
      for the outermost dimension.
      
      llvm-svn: 281165
      02293ed7
  4. Sep 09, 2016
  5. Sep 08, 2016
    • Michael Kruse's avatar
      Add -polly-flatten-schedule pass. · 7886bd7c
      Michael Kruse authored
      The -polly-flatten-schedule pass reduces the number of scattering
      dimensions in its isl_union_map form to make them easier to understand.
      It is not meant to be used in production, only for debugging and
      regression tests.
      
      To illustrate, how it can make sets simpler, here is a lifetime set
      used computed by the porposed DeLICM pass without flattening:
      
          { Stmt_reduction_for[0, 4] -> [0, 2, o2, o3] : o2 < 0;
            Stmt_reduction_for[0, 4] -> [0, 1, o2, o3] : o2 >= 5;
            Stmt_reduction_for[0, 4] -> [0, 1, 4, o3] : o3 > 0;
            Stmt_reduction_for[0, i1] -> [0, 1, i1, 1] : 0 <= i1 <= 3;
            Stmt_reduction_for[0, 4] -> [0, 2, 0, o3] : o3 <= 0 }
      
      And here the same lifetime for a semantically identical one-dimensional
      schedule:
      
          { Stmt_reduction_for[0, i1] -> [2 + 3i1] : 0 <= i1 <= 4 }
      
      Differential Revision: https://reviews.llvm.org/D24310
      
      llvm-svn: 280948
      7886bd7c
    • Tobias Grosser's avatar
      GICHelper: Correctly assign return value · a2d80ba5
      Tobias Grosser authored
      ... to preserve reference counting logic.
      
      In practice the missing assignment would not have caused any issues. We still
      fix it as the code is wrong and it also causes noise in the clang static
      analysis runs.
      
      llvm-svn: 280946
      a2d80ba5
    • Tobias Grosser's avatar
      SCEVAffinator: Add missing __isl_take annotations · b27ed0da
      Tobias Grosser authored
      llvm-svn: 280943
      b27ed0da
    • Tobias Grosser's avatar
      ScopInfo: Make clear that no double-free problem exists · 55a7af7d
      Tobias Grosser authored
      When running the clang static analyser to check for memory issues, this code
      originally showed a double free, as the analyser was unable to understand that
      isl_set_free always returns NULL and consequently later uses of the isl object
      we just freed will never be reached. Without this knowledge, the analyser has
      to issue a warning.
      
      We refactor the code to make it clear that for empty maps the current loop
      iteration is aborted.
      
      llvm-svn: 280940
      55a7af7d
    • Tobias Grosser's avatar
      ScopDetection: Make sure we do not accidentally divide by zero · b316dc16
      Tobias Grosser authored
      This code path is likely never triggered, but by still handling this case
      locally we avoid warnings in clangs static analyzer.
      
      llvm-svn: 280939
      b316dc16
    • Tobias Grosser's avatar
      DependenceInfo: Make clear that no double-free problem exists · adfc9718
      Tobias Grosser authored
      When running the clang static analyser to check for memory issues, this code
      originally showed a double free, as the analyser was unable to understand that
      isl_union_map_free always returns NULL and consequently later uses of the isl
      object we just freed will never be reached. Without this knowledge, the analyser
      has to issue a warning.
      
      We refactor the code to make it clear that for empty maps the current loop
      iteration is aborted.
      
      llvm-svn: 280938
      adfc9718
    • Tobias Grosser's avatar
      IslNodeBuilder: Add missing __isl_take annotations · f3600dfa
      Tobias Grosser authored
      llvm-svn: 280936
      f3600dfa
    • Tobias Grosser's avatar
      ScopInfo: Add missing __isl_take annotation · 2a526fee
      Tobias Grosser authored
      llvm-svn: 280923
      2a526fee
  6. Sep 07, 2016
    • Michael Kruse's avatar
      Disable MSVC warnings on ISL. · 349779cc
      Michael Kruse authored
      Disable some Visual C++ warnings on ISL. These are not reported by GCC/Clang in
      the ISL build system. We do not intend to fix them in the Polly in-tree copy,
      hence disable these warnings.
      
      llvm-svn: 280811
      349779cc
  7. Sep 03, 2016
    • Tobias Grosser's avatar
      ScopInfo: Do not derive assumptions from all GEP pointer instructions · 8d4cb1a0
      Tobias Grosser authored
      ... but instead rely on the assumptions that we derive for load/store
      instructions.
      
      Before we were able to delinearize arrays, we used GEP pointer instructions
      to derive information about the likely range of induction variables, which
      gave us more freedom during loop scheduling. Today, this is not needed
      any more as we delinearize multi-dimensional memory accesses and as part
      of this process also "assume" that all accesses to these arrays remain
      inbounds. The old derive-assumptions-from-GEP code has consequently become
      mostly redundant. We drop it both to clean up our code, but also to improve
      compile time. This change reduces the scop construction time for 3mm in
      no-asserts mode on my machine from 48 to 37 ms.
      
      llvm-svn: 280601
      8d4cb1a0
    • Tobias Grosser's avatar
      Dependences: Only create flat StmtSchedule in presence of reductions · 66c6506a
      Tobias Grosser authored
      Without reductions we do not need a flat union_map schedule describing
      the computation we want to perform, but can work purely on the schedule
      tree. This reduces the dependence computation and scheduling time from 33ms
      to 25ms. Another 30% reduction.
      
      llvm-svn: 280558
      66c6506a
    • Tobias Grosser's avatar
      Dependences: Exit early, if no reduction dependences are needed. · dff5de2e
      Tobias Grosser authored
      In case we do not compute reduction dependences or dependences that are more
      fine-grained than statement level dependences, we can avoid the corresponding
      part of the dependence analysis all together. For the 3mm benchmark, this
      reduces scheduling + dependence analysis time from 62ms to 33ms for a no-asserts
      build.  The majority of the compile time is anyhow spent in the LLVM backends,
      when doing code generation. Nevertheless, there is no need to waste compile time
      either.
      
      llvm-svn: 280557
      dff5de2e
    • Tobias Grosser's avatar
      Introduce option to run isl AST generation, but no IR generation. · b1000c39
      Tobias Grosser authored
      We replace the options
      
        -polly-code-generator=none
                             =isl
      
      with the options
      
        -polly-code-generation=none
                              =ast
                              =full
      
      This allows us to measure the overhead of Polly itself, versus the compile
      time increases due to us generating more IR and consequently the LLVM backends
      spending more time on this IR.
      
      We also use this opportunity to rename the option. The original name was
      introduced at a point where we still had two code generators. CLooG and the
      isl AST generator. Since we only have one AST generator left, there is no need
      to distinguish between 'isl' and something else. However, being able to disable
      code generation all together has been shown useful for debugging. Hence, we
      rename and extend this option to make it a good fit for its new use case.
      
      llvm-svn: 280554
      b1000c39
  8. Sep 02, 2016
    • Tobias Grosser's avatar
      Drop '@brief' from doxygen comments · c80d6979
      Tobias Grosser authored
      LLVM's coding guideline suggests to not use @brief for one-sentence doxygen
      comments to improve readability. Switch this once and for all to ensure people
      do not copy @brief comments from other parts of Polly, when writing new code.
      
      llvm-svn: 280468
      c80d6979
  9. Sep 01, 2016
    • Michael Kruse's avatar
      Allow mapping scalar MemoryAccesses to array elements. · 2fa35194
      Michael Kruse authored
      Change the code around setNewAccessRelation to allow to use a an existing array
      element for memory instead of an ad-hoc alloca. This facility will be used for
      DeLICM/DeGVN to convert scalar dependencies into regular ones.
      
      The changes necessary include:
      - Make the code generator use the implicit locations instead of the alloca ones.
      - A test case
      - Make the JScop importer accept changes of scalar accesses for that test case.
      - Adapt the MemoryAccess interface to the fact that the MemoryKind can change.
        They are named (get|is)OriginalXXX() to get the status of the memory access
        before any change by setNewAccessRelation() (some properties such as
        getIncoming() do not change even if the kind is changed and are still
        required). To get the modified properties, there is (get|is)LatestXXX(). The
        old accessors without Original|Latest become synonyms of the
        (get|is)OriginalXXX() to not make functional changes in unrelated code.
      
      Differential Revision: https://reviews.llvm.org/D23962
      
      llvm-svn: 280408
      2fa35194
    • Michael Kruse's avatar
      Check validity of new access relations. NFC. · 772ce720
      Michael Kruse authored
      There are some constraints on maps that can be access relations. In builds with assertions enabled, verify
      
        - The access domain is the same space as the statement's domain (modulo parameters).
        - Whether an access is defined for every instance of the statement. (codegen does not yet support partial access relations)
        - Whether the access range links to an array, represented by a ScopArrayInfo.
        - The number of access dimensions equals the dimensions of the array.
        - The array is not an indirect access. (also not supported by codegen)
      
      Differential Revision: https://reviews.llvm.org/D23916
      
      llvm-svn: 280404
      772ce720
    • Michael Kruse's avatar
      [ScopInfo] Add missing ISL annotations NFC. · d56b90a9
      Michael Kruse authored
      llvm-svn: 280343
      d56b90a9
    • Michael Kruse's avatar
      Update ISL to isl-0.17.1-203-g3fef898. · 77564f92
      Michael Kruse authored
      This version has isl_space_has_equal_tuples added to the public API.
      
      llvm-svn: 280341
      77564f92
  10. Aug 26, 2016
    • Michael Kruse's avatar
      Add space between access string and follow-up. · d262feff
      Michael Kruse authored
      llvm-svn: 279826
      d262feff
    • Tobias Grosser's avatar
      Improve documentation and testing for isl_valFromAPInt · 43720008
      Tobias Grosser authored
      
      
      The recent unit tests we gained made clear that the semantics of
      isl_valFromAPInt are not clear, due to missing documentation. In this change we
      document both the calling interface as well as the implementation of
      isl_valFromAPInt.
      
      We also make the implementation easier to read by removing integer wrappig in
      abs() when passing in the minimal integer value for a given bitwidth. Even
      though wrapping and subsequently interpreting the result as unsigned value gives
      the correct result, this is far from obvious.  Instead, we explicitly add one
      more bit to the input type to ensure that abs will never wrap. This change did
      not uncover a bug in the old implementation, but was introduced to increase
      readability.
      
      We update the tests to add a test case for this special case and use this
      opportunity to also test a number larger than 64 bit. Finally, we order the
      arguments of the test cases to make sure the expected output is first. This
      helps readability in case of failing test cases as gtest assumes the first value
      to be the exected value.
      
      Reviewed-by: default avatarMichael Kruse <llvm@meinersbur.de>
      Differential Revision: https://reviews.llvm.org/D23917
      
      llvm-svn: 279815
      43720008
    • Tobias Grosser's avatar
      Improve documentation and testing of APIntFromVal · 76f8279e
      Tobias Grosser authored
      
      
      The recent unit tests we gained made clear that the semantics of APIntFromVal
      are not clear, due to missing documentation. In this change we document both
      the calling interface as well as the implementation of APIntFromVal. We also
      make the implementation easier to read by removing the use of magic numbers.
      Finally, we add tests to check the bitwidth of the created values as well as
      the correct modeling of very large numbers.
      
      Reviewed-by: default avatarMichael Kruse <llvm@meinersbur.de>
      Differential Revision: https://reviews.llvm.org/D23910
      
      llvm-svn: 279813
      76f8279e
  11. Aug 23, 2016
  12. Aug 21, 2016
  13. Aug 18, 2016
    • Eli Friedman's avatar
      [SCEVValidator] Don't reorder multiplies in extractConstantFactor. · 28671c83
      Eli Friedman authored
      The existing code would add the operands in the wrong order, and eventually
      crash because the SCEV expression doesn't exactly match the parameter SCEV
      expression in SCEVAffinator::visit. (SCEV doesn't sort the operands to
      getMulExpr in general.)
      
      Differential Revision: https://reviews.llvm.org/D23592
      
      llvm-svn: 279087
      28671c83
    • Tobias Grosser's avatar
      [BlockGenerator] Invalidate SCEV values for instructions in scop · 1c184409
      Tobias Grosser authored
      We already invalidated a couple of critical values earlier on, but we now
      invalidate all instructions contained in a scop after the scop has been code
      generated. This is necessary as later scops may otherwise obtain SCEV
      expressions that reference values in the earlier scop that before dominated
      the later scop, but which had been moved into the conditional branch and
      consequently do not dominate the later scop any more. If these very values are
      then used during code generation of the later scop, we generate used that are
      dominated by the values they use.
      
      This fixes: http://llvm.org/PR28984
      
      llvm-svn: 279047
      1c184409
  14. Aug 17, 2016
  15. Aug 16, 2016
    • Tobias Grosser's avatar
      [ScopInfo] Make scalars used by PHIs in non-affine regions available · b143e311
      Tobias Grosser authored
      Normally this is ensured when adding PHI nodes, but as PHI node dependences
      do not need to be added in case all incoming blocks are within the same
      non-affine region, this was missed.
      
      This corrects an issue visible in LNT's sqlite3, in case invariant load hoisting
      was disabled.
      
      llvm-svn: 278792
      b143e311
  16. Aug 15, 2016
Loading