Skip to content
  1. Oct 12, 2015
  2. Oct 09, 2015
  3. Oct 07, 2015
  4. Oct 06, 2015
  5. Oct 03, 2015
    • Piotr Padlewski's avatar
      inariant.group handling in GVN · dc9b2cfc
      Piotr Padlewski authored
      The most important part required to make clang
      devirtualization works ( ͡°͜ʖ ͡°).
      The code is able to find non local dependencies, but unfortunatelly
      because the caller can only handle local dependencies, I had to add
      some restrictions to look for dependencies only in the same BB.
      
      http://reviews.llvm.org/D12992
      
      llvm-svn: 249196
      dc9b2cfc
  6. Oct 02, 2015
  7. Sep 30, 2015
  8. Sep 29, 2015
    • Evgeniy Stepanov's avatar
      Move dbg.declare intrinsics when merging and replacing allocas. · d8b86f7c
      Evgeniy Stepanov authored
      Place new and update dbg.declare calls immediately after the
      corresponding alloca.
      
      Current code in replaceDbgDeclareForAlloca puts the new dbg.declare
      at the end of the basic block. LLVM codegen has problems emitting
      debug info in a situation when dbg.declare appears after all uses of
      the variable. This usually kinda works for inlining and ASan (two
      users of this function) but not for SafeStack (see the pending change
      in http://reviews.llvm.org/D13178).
      
      llvm-svn: 248769
      d8b86f7c
  9. Sep 28, 2015
    • Fiona Glaser's avatar
      Improve performance of SimplifyInstructionsInBlock · f74cc40e
      Fiona Glaser authored
      1. Use a worklist, not a recursive approach, to avoid needless
         revisitation and being repeatedly forced to jump back to the
         start of the BB if a handle is invalidated.
      
      2. Only insert operands to the worklist if they become unused
         after a dead instruction is removed, so we don’t have to
         visit them again in most cases.
      
      3. Use a SmallSetVector to track the worklist.
      
      4. Instead of pre-initting the SmallSetVector like in
         DeadCodeEliminationPass, only put things into the worklist
         if they have to be revisited after the first run-through.
         This minimizes how much the actual SmallSetVector gets used,
         which saves a lot of time.
      
      llvm-svn: 248727
      f74cc40e
  10. Sep 27, 2015
    • Joseph Tremoulet's avatar
      [EH] Create removeUnwindEdge utility · 09af67ab
      Joseph Tremoulet authored
      Summary:
      Factor the code that rewrites invokes to calls and rewrites WinEH
      terminators to their "unwind to caller" equivalents into a helper in
      Utils/Local, and use it in the three places I'm aware of that need to do
      this.
      
      
      Reviewers: andrew.w.kaylor, majnemer, rnk
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D13152
      
      llvm-svn: 248677
      09af67ab
  11. Sep 24, 2015
  12. Sep 23, 2015
  13. Sep 21, 2015
  14. Sep 16, 2015
  15. Sep 15, 2015
  16. Sep 14, 2015
    • David Blaikie's avatar
      [opaque pointer types] Switch a few cases of getElementType over, since I had... · 6614d8d2
      David Blaikie authored
      [opaque pointer types] Switch a few cases of getElementType over, since I had them lying around anyway
      
      llvm-svn: 247610
      6614d8d2
    • David Blaikie's avatar
      Revert "[opaque pointer type] Pass GlobalAlias the actual pointer type rather... · 16a2f3e3
      David Blaikie authored
      Revert "[opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space"
      
      This was a flawed change - it just caused the getElementType call to be
      deferred until later, when we really need to remove it. Now that the IR
      for GlobalAliases has been updated, the root cause is addressed that way
      instead and this change is no longer needed (and in fact gets in the way
      - because we want to pass the pointee type directly down further).
      
      Follow up patches to push this through GlobalValue, bitcode format, etc,
      will come along soon.
      
      This reverts commit 236160.
      
      llvm-svn: 247585
      16a2f3e3
  17. Sep 11, 2015
  18. Sep 10, 2015
    • Matthew Simpson's avatar
      [LV] Relax Small Size Reduction Type Requirement · 29dc0f70
      Matthew Simpson authored
      This patch enables small size reductions in which the source types are smaller
      than the reduction type (e.g., computing an i16 sum from the values in an i8
      array). The previous behavior was to only allow small size reductions if the
      source types and reduction type were the same. The change accounts for the fact
      that the existing sign- and zero-extend instructions in these cases should
      still be included in the cost model.
      
      Differential Revision: http://reviews.llvm.org/D12770
      
      llvm-svn: 247337
      29dc0f70
    • Philip Reames's avatar
      [SimplifyCFG] Use known bits to eliminate dead switch defaults · 05370139
      Philip Reames authored
      This is a follow up to http://reviews.llvm.org/D11995 implementing the suggestion by Hans.
      
      If we know some of the bits of the value being switched on, we know that the maximum number of unique cases covers the unknown bits. This allows to eliminate switch defaults for large integers (i32) when most bits in the value are known.
      
      Note that I had to make the transform contingent on not having any dead cases. This is conservatively correct with the old code, but required for the new code since we might have a dead case which varies one of the known bits. Counting that towards our number of covering cases would be bad.  If we do have dead cases, we'll eliminate them first, then revisit the possibly dead default.
      
      Differential Revision: http://reviews.llvm.org/D12497
      
      llvm-svn: 247309
      05370139
    • Sanjay Patel's avatar
      80-cols; NFC · 9361d355
      Sanjay Patel authored
      llvm-svn: 247295
      9361d355
    • Sanjay Patel's avatar
      use range-based for loop; NFCI · f4b34b76
      Sanjay Patel authored
      llvm-svn: 247294
      f4b34b76
    • Sanjay Patel's avatar
      use range-based for loop; NFCI · 5e7bd918
      Sanjay Patel authored
      llvm-svn: 247293
      5e7bd918
    • Sanjay Patel's avatar
      fix typo; NFC · 59661459
      Sanjay Patel authored
      llvm-svn: 247287
      59661459
  19. Sep 09, 2015
    • Chandler Carruth's avatar
      [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible · 7b560d40
      Chandler Carruth authored
      with the new pass manager, and no longer relying on analysis groups.
      
      This builds essentially a ground-up new AA infrastructure stack for
      LLVM. The core ideas are the same that are used throughout the new pass
      manager: type erased polymorphism and direct composition. The design is
      as follows:
      
      - FunctionAAResults is a type-erasing alias analysis results aggregation
        interface to walk a single query across a range of results from
        different alias analyses. Currently this is function-specific as we
        always assume that aliasing queries are *within* a function.
      
      - AAResultBase is a CRTP utility providing stub implementations of
        various parts of the alias analysis result concept, notably in several
        cases in terms of other more general parts of the interface. This can
        be used to implement only a narrow part of the interface rather than
        the entire interface. This isn't really ideal, this logic should be
        hoisted into FunctionAAResults as currently it will cause
        a significant amount of redundant work, but it faithfully models the
        behavior of the prior infrastructure.
      
      - All the alias analysis passes are ported to be wrapper passes for the
        legacy PM and new-style analysis passes for the new PM with a shared
        result object. In some cases (most notably CFL), this is an extremely
        naive approach that we should revisit when we can specialize for the
        new pass manager.
      
      - BasicAA has been restructured to reflect that it is much more
        fundamentally a function analysis because it uses dominator trees and
        loop info that need to be constructed for each function.
      
      All of the references to getting alias analysis results have been
      updated to use the new aggregation interface. All the preservation and
      other pass management code has been updated accordingly.
      
      The way the FunctionAAResultsWrapperPass works is to detect the
      available alias analyses when run, and add them to the results object.
      This means that we should be able to continue to respect when various
      passes are added to the pipeline, for example adding CFL or adding TBAA
      passes should just cause their results to be available and to get folded
      into this. The exception to this rule is BasicAA which really needs to
      be a function pass due to using dominator trees and loop info. As
      a consequence, the FunctionAAResultsWrapperPass directly depends on
      BasicAA and always includes it in the aggregation.
      
      This has significant implications for preserving analyses. Generally,
      most passes shouldn't bother preserving FunctionAAResultsWrapperPass
      because rebuilding the results just updates the set of known AA passes.
      The exception to this rule are LoopPass instances which need to preserve
      all the function analyses that the loop pass manager will end up
      needing. This means preserving both BasicAAWrapperPass and the
      aggregating FunctionAAResultsWrapperPass.
      
      Now, when preserving an alias analysis, you do so by directly preserving
      that analysis. This is only necessary for non-immutable-pass-provided
      alias analyses though, and there are only three of interest: BasicAA,
      GlobalsAA (formerly GlobalsModRef), and SCEVAA. Usually BasicAA is
      preserved when needed because it (like DominatorTree and LoopInfo) is
      marked as a CFG-only pass. I've expanded GlobalsAA into the preserved
      set everywhere we previously were preserving all of AliasAnalysis, and
      I've added SCEVAA in the intersection of that with where we preserve
      SCEV itself.
      
      One significant challenge to all of this is that the CGSCC passes were
      actually using the alias analysis implementations by taking advantage of
      a pretty amazing set of loop holes in the old pass manager's analysis
      management code which allowed analysis groups to slide through in many
      cases. Moving away from analysis groups makes this problem much more
      obvious. To fix it, I've leveraged the flexibility the design of the new
      PM components provides to just directly construct the relevant alias
      analyses for the relevant functions in the IPO passes that need them.
      This is a bit hacky, but should go away with the new pass manager, and
      is already in many ways cleaner than the prior state.
      
      Another significant challenge is that various facilities of the old
      alias analysis infrastructure just don't fit any more. The most
      significant of these is the alias analysis 'counter' pass. That pass
      relied on the ability to snoop on AA queries at different points in the
      analysis group chain. Instead, I'm planning to build printing
      functionality directly into the aggregation layer. I've not included
      that in this patch merely to keep it smaller.
      
      Note that all of this needs a nearly complete rewrite of the AA
      documentation. I'm planning to do that, but I'd like to make sure the
      new design settles, and to flesh out a bit more of what it looks like in
      the new pass manager first.
      
      Differential Revision: http://reviews.llvm.org/D12080
      
      llvm-svn: 247167
      7b560d40
  20. Sep 07, 2015
  21. Sep 05, 2015
  22. Sep 03, 2015
    • Joseph Tremoulet's avatar
      [WinEH] Add cleanupendpad instruction · 9ce71f76
      Joseph Tremoulet authored
      Summary:
      Add a `cleanupendpad` instruction, used to mark exceptional exits out of
      cleanups (for languages/targets that can abort a cleanup with another
      exception).  The `cleanupendpad` instruction is similar to the `catchendpad`
      instruction in that it is an EH pad which is the target of unwind edges in
      the handler and which itself has an unwind edge to the next EH action.
      The `cleanupendpad` instruction, similar to `cleanupret` has a `cleanuppad`
      argument indicating which cleanup it exits.  The unwind successors of a
      `cleanuppad`'s `cleanupendpad`s must agree with each other and with its
      `cleanupret`s.
      
      Update WinEHPrepare (and docs/tests) to accomodate `cleanupendpad`.
      
      Reviewers: rnk, andrew.w.kaylor, majnemer
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D12433
      
      llvm-svn: 246751
      9ce71f76
  23. Sep 02, 2015
    • Piotr Padlewski's avatar
      Constant propagation after hitting assume(cmp) bugfix · 28ffcbe1
      Piotr Padlewski authored
      Last time code run into assertion `BBE.isSingleEdge()` in
      lib/IR/Dominators.cpp:200.
      
      http://reviews.llvm.org/D12170
      
      llvm-svn: 246696
      28ffcbe1
    • Benjamin Kramer's avatar
      [RemoveDuplicatePHINodes] Start over after removing a PHI. · f175e044
      Benjamin Kramer authored
      This makes RemoveDuplicatePHINodes more effective and fixes an assertion
      failure. Triggering the assertions requires a DenseSet reallocation
      so this change only contains a constructive test.
      
      I'll explain the issue with a small example. In the following function
      there's a duplicate PHI, %4 and %5 are identical. When this is found
      the DenseSet in RemoveDuplicatePHINodes contains %2, %3 and %4.
      
      define void @F() {
        br label %1
      
      ; <label>:1                                       ; preds = %1, %0
        %2 = phi i32 [ 42, %0 ], [ %4, %1 ]
        %3 = phi i32 [ 42, %0 ], [ %5, %1 ]
        %4 = phi i32 [ 42, %0 ], [ 23, %1 ]
        %5 = phi i32 [ 42, %0 ], [ 23, %1 ]
        br label %1
      }
      
      after RemoveDuplicatePHINodes runs the function looks like this. %3 has
      changed and is now identical to %2, but RemoveDuplicatePHINodes never
      saw this.
      
      define void @F() {
        br label %1
      
      ; <label>:1                                       ; preds = %1, %0
        %2 = phi i32 [ 42, %0 ], [ %4, %1 ]
        %3 = phi i32 [ 42, %0 ], [ %4, %1 ]
        %4 = phi i32 [ 42, %0 ], [ 23, %1 ]
        br label %1
      }
      
      If the DenseSet does a reallocation now it will reinsert all
      keys and stumble over %3 now having a different hash value than it had
      when inserted into the map for the first time. This change clears the
      set whenever a PHI is deleted and starts the progress from the
      beginning, allowing %3 to be deleted and avoiding inconsistent DenseSet
      state. This potentially has a negative performance impact because
      it rescans all PHIs, but I don't think that this ever makes a difference
      in practice.
      
      llvm-svn: 246694
      f175e044
  24. Aug 28, 2015
  25. Aug 27, 2015
    • Chad Rosier's avatar
      [LoopVectorize] Add Support for Small Size Reductions. · c94f8e29
      Chad Rosier authored
      Unlike scalar operations, we can perform vector operations on element types that
      are smaller than the native integer types. We type-promote scalar operations if
      they are smaller than a native type (e.g., i8 arithmetic is promoted to i32
      arithmetic on Arm targets). This patch detects and removes type-promotions
      within the reduction detection framework, enabling the vectorization of small
      size reductions.
      
      In the legality phase, we look through the ANDs and extensions that InstCombine
      creates during promotion, keeping track of the smaller type. In the
      profitability phase, we use the smaller type and ignore the ANDs and extensions
      in the cost model. Finally, in the code generation phase, we truncate the result
      of the reduction to allow InstCombine to rewrite the entire expression in the
      smaller type.
      
      This fixes PR21369.
      http://reviews.llvm.org/D12202
      
      Patch by Matt Simpson <mssimpso@codeaurora.org>!
      
      llvm-svn: 246149
      c94f8e29
Loading