Skip to content
  1. Jan 09, 2018
  2. Jan 08, 2018
  3. Jan 07, 2018
    • Davide Italiano's avatar
      Revert "[SCCP] Manually fold branches on undef." · e15bffe9
      Davide Italiano authored
      I thought this was responsible for PR35723, but I was
      wrong, the issue lies elsewhere. Revert while I debug.
      
      llvm-svn: 321975
      e15bffe9
    • Davide Italiano's avatar
      [SLPVectorizer] Reintroduce std::stable_sort(properlyDominates()). · 4c39758a
      Davide Italiano authored
      The approach was never discussed, I wasn't able to reproduce this
      non-determinism, and the original author went AWOL.
      After a discussion on the ML, Philip suggested to revert this.
      
      llvm-svn: 321974
      4c39758a
    • Hal Finkel's avatar
      [LV][VPlan] NFC patch to move LoopVectorizationPlanner class out of LoopVectorize.cpp · 0f1314c5
      Hal Finkel authored
      Another small step forward to move VPlan stuff outside of LoopVectorize.cpp.
      
      VPlanBuilder.h is renamed to LoopVectorizationPlanner.h
      LoopVectorizationPlanner class is moved from LoopVectorize.cpp to
      LoopVectorizationPlanner.h LoopVectorizationCostModel::VectorizationFactor
      class is moved to LoopVectorizationPlanner.h (used by the planner class) ---
      this needs further streamlining work in later patches and thus all I did was
      take it out of the CostModel class and moved to the header file.  The callback
      function had to stay inside LoopVectorize.cpp since it calls an
      InnerLoopVectorizer member function declared in it.  Next Steps: Make
      InnerLoopVectorizer, LoopVectorizationCostModel, and other classes more modular
      and more aligned with VPlan direction, in small increments.
      
      Previous step was: r320900 (https://reviews.llvm.org/D41045)
      
      Patch by Hideki Saito, thanks!
      
      Differential Revision: https://reviews.llvm.org/D41420
      
      llvm-svn: 321962
      0f1314c5
    • Florian Hahn's avatar
      [CodeExtractor] Use subset of function attributes for extracted function. · 55be37e7
      Florian Hahn authored
      In addition to target-dependent attributes, we can also preserve a
      white-listed subset of target independent function attributes. The white-list
      excludes problematic attributes, most prominently:
      
      * attributes related to memory accesses, as alloca instructions
        could be moved in/out of the extracted block
      
      * control-flow dependent attributes, like no_return or thunk, as the
        relerelevant instructions might or might not get extracted.
      
      Thanks @efriedma and @aemerson for providing a set of attributes that cannot be
      propagated.
      
      
      Reviewers: efriedma, davidxl, davide, silvas
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D41334
      
      llvm-svn: 321961
      55be37e7
  4. Jan 06, 2018
  5. Jan 05, 2018
  6. Jan 04, 2018
  7. Jan 03, 2018
    • Matt Arsenault's avatar
      StructurizeCFG: Fix broken backedge detection · 8070882b
      Matt Arsenault authored
      The work order was changed in r228186 from SCC order
      to RPO with an arbitrary sorting function. The sorting
      function attempted to move inner loop nodes earlier. This
      was was apparently relying on an assumption that every block
      in a given loop / the same loop depth would be seen before
      visiting another loop. In the broken testcase, a block
      outside of the loop was encountered before moving onto
      another block in the same loop. The testcase would then
      structurize such that one blocks unconditional successor
      could never be reached.
      
      Revert to plain RPO for the analysis phase. This fixes
      detecting edges as backedges that aren't really.
      
      The processing phase does use another visited set, and
      I'm unclear on whether the order there is as important.
      An arbitrary order doesn't work, and triggers some infinite
      loops. The reversed RPO list seems to work and is closer
      to the order that was used before, minus the arbitary
      custom sorting.
      
      A few of the changed tests now produce smaller code,
      and a few are slightly worse looking.
      
      llvm-svn: 321751
      8070882b
    • Simon Pilgrim's avatar
      [InstCombine] Check for out of range shift values using APInt before calling getZExtValue · 3bf2d645
      Simon Pilgrim authored
      Reduced from oss-fuzz #4871 test case
      
      llvm-svn: 321748
      3bf2d645
  8. Jan 02, 2018
    • Anna Thomas's avatar
      [BasicBlockUtils] Check for unreachable preds before updating LI in UpdateAnalysisInformation · bdb94309
      Anna Thomas authored
      Summary:
      We are incorrectly updating the LI when loop-simplify generates
      dedicated exit blocks for a loop. The issue is that there's an implicit
      assumption that the Preds passed into UpdateAnalysisInformation are
      reachable. However, this is not true and breaks LI by incorrectly
      updating the header of a loop.
      
      One such case is when we generate dedicated exits when the exit block is
      a landing pad (through SplitLandingPadPredecessors). There maybe other
      cases as well, since we do not guarantee that Preds passed in are
      reachable basic blocks.
      
      The added test case shows how loop-simplify breaks LI for the outer loop (and DT in turn)
      after we try to generate the LoopSimplifyForm.
      
      Reviewers: davide, chandlerc, sanjoy
      
      Reviewed By: davide
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41519
      
      llvm-svn: 321653
      bdb94309
    • Dmitry Venikov's avatar
      [InstCombine] Missed optimization in math expression: squashing sqrt functions · a58d8deb
      Dmitry Venikov authored
      Summary: This patch enables folding under -ffast-math flag sqrt(a) * sqrt(b) -> sqrt(a*b)
      
      Reviewers: hfinkel, spatel, davide
      
      Reviewed By: spatel, davide
      
      Subscribers: davide, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41322
      
      llvm-svn: 321637
      a58d8deb
  9. Dec 31, 2017
  10. Dec 30, 2017
  11. Dec 29, 2017
  12. Dec 28, 2017
    • Benjamin Kramer's avatar
      Remove superfluous copies in sample profiling. · 24cb28bb
      Benjamin Kramer authored
      No functionliaty change intended.
      
      llvm-svn: 321530
      24cb28bb
    • Guozhi Wei's avatar
      Revert r321377, it causes regression to https://reviews.llvm.org/P8055. · 29697c13
      Guozhi Wei authored
      llvm-svn: 321528
      29697c13
    • Benjamin Kramer's avatar
      Avoid int to string conversion in Twine or raw_ostream contexts. · 3a13ed60
      Benjamin Kramer authored
      Some output changes from uppercase hex to lowercase hex, no other functionality change intended.
      
      llvm-svn: 321526
      3a13ed60
    • Max Kazantsev's avatar
      [RewriteStatepoints] Fix incorrect assertion · a13e163a
      Max Kazantsev authored
      `RewriteStatepointsForGC` iterates over function blocks and their predecessors
      in order of declaration. One of outcomes of this is that callsites are placed in
      arbitrary order which has nothing to do with travelsar order.
      
      On the other hand, function `recomputeLiveInValues` asserts that bases are
      added to `Info.PointerToBase` before their deried pointers are updated. But
      if call sites are processed in order different from RPOT, this is not necessarily
      true. We cannot guarantee that the base was placed there before every
      pointer derived from it. All we can guarantee is that this base was marked as
      known base by this point.
      
      This patch replaces the fact that we assert from checking that the base was
      added to the map with assert that the base was marked as known base.
      
      Differential Revision: https://reviews.llvm.org/D41593
      
      llvm-svn: 321517
      a13e163a
    • Simon Pilgrim's avatar
      [InstCombine] Check for isa<Instruction> before using cast<> · 472689a1
      Simon Pilgrim authored
      Protects against casts from constexpr etc.
      
      Reduced from oss-fuzz #4788 test case
      
      llvm-svn: 321515
      472689a1
    • Reid Kleckner's avatar
      Revert "[memcpyopt] Teach memcpyopt to optimize across basic blocks" · 6d31001c
      Reid Kleckner authored
      This reverts r321138. It seems there are still underlying issues with
      memdep. PR35519 seems to still be present if debug info is enabled. We
      end up losing a memcpy. Somehow during store to memset merging, we
      insert the memset after the memcpy or fail to update the memdep analysis
      to account for the newly inserted memset of a pair.
      
      Reduced test case:
      
        #include <assert.h>
        #include <stdio.h>
        #include <string>
        #include <utility>
        #include <vector>
      
        void do_push_back(
            std::vector<std::pair<std::string, std::vector<std::string>>>* crls) {
          crls->push_back(std::make_pair(std::string(), std::vector<std::string>()));
        }
      
        int __attribute__((optnone)) main() {
          // Put some data in the vector and then remove it so we take the push_back
          // fast path.
          std::vector<std::pair<std::string, std::vector<std::string>>> crl_set;
          crl_set.push_back({"asdf", {}});
          crl_set.pop_back();
          printf("first word in vector storage: %p\n", *(void**)crl_set.data());
      
          // Do the push_back which may fail to initialize the data.
          do_push_back(&crl_set);
          auto* first = &crl_set.back().first;
          printf("first word in vector storage (should be zero): %p\n",
                 *(void**)crl_set.data());
          assert(first->empty());
          puts("ok");
        }
      
      Compile with libc++, enable optimizations, and enable debug info:
      $ clang++ -stdlib=libc++ -g -O2 t.cpp -o t.exe -Wl,-rpath=llvm/build/lib
      
      This program will assert with this change.
      
      llvm-svn: 321510
      6d31001c
  13. Dec 27, 2017
Loading