Skip to content
  1. Dec 20, 2016
    • Adrian Prantl's avatar
      [IR] Remove the DIExpression field from DIGlobalVariable. · bceaaa96
      Adrian Prantl authored
      This patch implements PR31013 by introducing a
      DIGlobalVariableExpression that holds a pair of DIGlobalVariable and
      DIExpression.
      
      Currently, DIGlobalVariables holds a DIExpression. This is not the
      best way to model this:
      
      (1) The DIGlobalVariable should describe the source level variable,
          not how to get to its location.
      
      (2) It makes it unsafe/hard to update the expressions when we call
          replaceExpression on the DIGLobalVariable.
      
      (3) It makes it impossible to represent a global variable that is in
          more than one location (e.g., a variable with multiple
          DW_OP_LLVM_fragment-s).  We also moved away from attaching the
          DIExpression to DILocalVariable for the same reasons.
      
      This reapplies r289902 with additional testcase upgrades and a change
      to the Bitcode record for DIGlobalVariable, that makes upgrading the
      old format unambiguous also for variables without DIExpressions.
      
      <rdar://problem/29250149>
      https://llvm.org/bugs/show_bug.cgi?id=31013
      Differential Revision: https://reviews.llvm.org/D26769
      
      llvm-svn: 290153
      bceaaa96
  2. Dec 19, 2016
  3. Dec 18, 2016
    • Sanjay Patel's avatar
      [InstCombine] use commutative matchers for patterns with commutative operators · 2b9d4b4d
      Sanjay Patel authored
      Background/motivation - I was circling back around to:
      https://llvm.org/bugs/show_bug.cgi?id=28296
      
      I made a simple patch for that and noticed some regressions, so added test cases for
      those with rL281055, and this is hopefully the minimal fix for just those cases.
      
      But as you can see from the surrounding untouched folds, we are missing commuted patterns
      all over the place, and of course there are no regression tests to cover any of those cases.
      
      We could sprinkle "m_c_" dust all over this file and catch most of the missing folds, but 
      then we still wouldn't have test coverage, and we'd still miss some fraction of commuted 
      patterns because they require adjustments to the match order.
      
      I'm aware of the concern about the potential compile-time performance impact of adding 
      matches like this (currently being discussed on llvm-dev), but I don't think there's any
      evidence yet to suggest that handling commutative pattern matching more thoroughly is not
      a worthwhile goal of InstCombine.
      
      Differential Revision: https://reviews.llvm.org/D24419
      
      llvm-svn: 290067
      2b9d4b4d
  4. Dec 17, 2016
  5. Dec 16, 2016
  6. Dec 15, 2016
    • Teresa Johnson's avatar
      [ThinLTO] Revert part of r289843 that belonged to another patch. · eb0ac241
      Teresa Johnson authored
      The code change for D27687 accidentally got committed along with the
      main change in r289843. Revert it temporarily, so that I can recommit it
      along with its test as intended.
      
      llvm-svn: 289875
      eb0ac241
    • Teresa Johnson's avatar
      [ThinLTO] Remove stale comment (NFC) · 0c3f57b1
      Teresa Johnson authored
      This should have been removed with r288446.
      
      llvm-svn: 289871
      0c3f57b1
    • Teresa Johnson's avatar
      [ThinLTO] Thin link efficiency: skip candidate added later with higher threshold (NFC) · 475b51a7
      Teresa Johnson authored
      Summary:
      Thin link efficiency improvement. After adding an importing candidate to
      the worklist we might have later added it again with a higher threshold.
      Skip it when popped from the worklist if we recorded a higher threshold
      than the current worklist entry, it will get processed again at the
      higher threshold when that entry is popped.
      
      This required adding the summary's GUID to the worklist, so that it can
      be used to query the recorded highest threshold for it when we pop from the
      worklist.
      
      Reviewers: mehdi_amini
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D27696
      
      llvm-svn: 289867
      475b51a7
    • Matthew Simpson's avatar
      [LV] Enable vectorization of loops with conditional stores by default · 6a98bcfe
      Matthew Simpson authored
      This patch sets the default value of the "-enable-cond-stores-vec" command line
      option to "true".
      
      Differential Revision: https://reviews.llvm.org/D27814
      
      llvm-svn: 289863
      6a98bcfe
    • Andrea Di Biagio's avatar
      [SimplifyCFG] Merge debug locations when hoisting an instruction from a then/else branch. NFC. · f20c57ec
      Andrea Di Biagio authored
      Now that a new API to merge debug locations has been committed at r289661 (see
      review D26256 for more details), we can use it to "improve" the code added by
      revision r280995.
      
      Instead of nulling the debugloc of a commoned instruction, we use the 'merged'
      debug location. At the moment, this is just a no functional change since
      function `DILocation::getMergedLocation()` is just a stub and would always
      return a null location.
      
      Differential Revision: https://reviews.llvm.org/D27804
      
      llvm-svn: 289862
      f20c57ec
    • Sanjay Patel's avatar
      [InstCombine] add folds for icmp (smin X, Y), X · d640641a
      Sanjay Patel authored
      Min/max canonicalization (r287585) exposes the fact that we're missing combines for min/max patterns. 
      This patch won't solve the example that was attached to that thread, so something else still needs fixing.
      
      The line between InstCombine and InstSimplify gets blurry here because sometimes the icmp instruction that
      we want to fold to already exists, but sometimes it's the swapped form of what we want.
      
      Corresponding changes for smax/umin/umax to follow.
      
      Differential Revision: https://reviews.llvm.org/D27531
      
      llvm-svn: 289855
      d640641a
    • Teresa Johnson's avatar
      [ThinLTO] Ensure callees get hot threshold when first seen on cold path · 1b859a23
      Teresa Johnson authored
      This is split out from D27696, since it turned out to be a bug fix and
      not part of the NFC efficiency change.
      
      Keep the same adjusted (possibly decayed) threshold in both the worklist
      and the ImportList. Otherwise if we encountered it first along a cold
      path, the callee would be added to the worklist with a lower decayed
      threshold than when it is later encountered along a hot path. But the
      logic uses the threshold recorded in the ImportList entry to check if
      we should re-add it, and without this patch the threshold recorded there
      is the same along both paths so we don't re-add it. Using the
      same possibly decayed threshold in the ImportList ensures we re-add it
      later with the higher non-decayed hot path threshold.
      
      llvm-svn: 289843
      1b859a23
    • Robert Lougher's avatar
      Revert "[SimplifyCFG] In sinkLastInstruction correctly set debugloc of common inst" · 6ea759a8
      Robert Lougher authored
      Reverting as it is causing buildbot failures (address sanitizer).
      
      llvm-svn: 289833
      6ea759a8
    • Robert Lougher's avatar
      [SimplifyCFG] In sinkLastInstruction correctly set debugloc of "common" inst · cf176742
      Robert Lougher authored
      Simplify CFG will try to sink the last instruction in a series of basic blocks,
      creating a "common" instruction in the successor block (sinkLastInstruction).
      When it does this, the debug location of the single instruction should be the
      merged debug locations of the commoned instructions.
      
      Differential Revision: https://reviews.llvm.org/D27590
      
      llvm-svn: 289828
      cf176742
    • Ehsan Amiri's avatar
      [InstCombine] New opportunities for FoldAndOfICmp and FoldXorOfICmp · 795b0671
      Ehsan Amiri authored
      A number of new patterns for simplifying and/xor of icmp:
      
      (icmp ne %x, 0) ^ (icmp ne %y, 0) => icmp ne %x, %y if the following is true:
      1- (%x = and %a, %mask) and (%y = and %b, %mask)
      2- %mask is a power of 2.
      
      (icmp eq %x, 0) & (icmp ne %y, 0) => icmp ult %x, %y if the following is true:
      1- (%x = and %a, %mask1) and (%y = and %b, %mask2)
      2- Let %t be the smallest power of 2 where %mask1 & %t != 0. Then for any
         %s that is a power of 2 and %s & %mask2 != 0, we must have %s <= %t.
      For example if %mask1 = 24 and %mask2 = 16, setting %s = 16 and %t = 8
      violates condition (2) above. So this optimization cannot be applied.
      
      llvm-svn: 289813
      795b0671
    • Craig Topper's avatar
    • Hal Finkel's avatar
      Remove the AssumptionCache · 3ca4a6bc
      Hal Finkel authored
      After r289755, the AssumptionCache is no longer needed. Variables affected by
      assumptions are now found by using the new operand-bundle-based scheme. This
      new scheme is more computationally efficient, and also we need much less
      code...
      
      llvm-svn: 289756
      3ca4a6bc
    • Hal Finkel's avatar
      Make processing @llvm.assume more efficient by using operand bundles · cb9f78e1
      Hal Finkel authored
      There was an efficiency problem with how we processed @llvm.assume in
      ValueTracking (and other places). The AssumptionCache tracked all of the
      assumptions in a given function. In order to find assumptions relevant to
      computing known bits, etc. we searched every assumption in the function. For
      ValueTracking, that means that we did O(#assumes * #values) work in InstCombine
      and other passes (with a constant factor that can be quite large because we'd
      repeat this search at every level of recursion of the analysis).
      
      Several of us discussed this situation at the last developers' meeting, and
      this implements the discussed solution: Make the values that an assume might
      affect operands of the assume itself. To avoid exposing this detail to
      frontends and passes that need not worry about it, I've used the new
      operand-bundle feature to add these extra call "operands" in a way that does
      not affect the intrinsic's signature. I think this solution is relatively
      clean. InstCombine adds these extra operands based on what ValueTracking, LVI,
      etc. will need and then those passes need only search the users of the values
      under consideration. This should fix the computational-complexity problem.
      
      At this point, no passes depend on the AssumptionCache, and so I'll remove
      that as a follow-up change.
      
      Differential Revision: https://reviews.llvm.org/D27259
      
      llvm-svn: 289755
      cb9f78e1
  7. Dec 14, 2016
Loading