Skip to content
  1. Aug 04, 2015
    • Duncan P. N. Exon Smith's avatar
      Linker: Fix references to uniqued nodes after r243883 · 706f37e8
      Duncan P. N. Exon Smith authored
      r243883 started moving 'distinct' nodes instead of duplicated them in
      lib/Linker.  This had the side-effect of sometimes not cloning uniqued
      nodes that reference them.  I missed a corner case:
      
          !named = !{!0}
          !0 = !{!1}
          !1 = distinct !{!0}
      
      !0 is the entry point for "remapping", and a temporary clone (say,
      !0-temp) is created and mapped in case we need to model a uniquing
      cycle.
      
          Recursive descent into !1.  !1 is distinct, so we leave it alone,
          but update its operand to !0-temp.
      
      Pop back out to !0.  Its only operand, !1, hasn't changed, so we don't
      need to use !0-temp.  !0-temp goes out of scope, and we're finished
      remapping, but we're left with:
      
          !named = !{!0}
          !0 = !{!1}
          !1 = distinct !{null} ; uh oh...
      
      Previously, if !0 and !0-temp ended up with identical operands, then
      !0-temp couldn't have been referenced at all.  Now that distinct nodes
      don't get duplicated, that assumption is invalid.  We need to
      !0-temp->replaceAllUsesWith(!0) before freeing !0-temp.
      
      I found this while running an internal `-flto -g` bootstrap.  Strangely,
      there was no case of this in the open source bootstrap I'd done before
      commit...
      
      llvm-svn: 243961
      706f37e8
    • Adam Nemet's avatar
      [LoopVer] Remove unused needsRuntimeChecks(), NFC · 6b6082dc
      Adam Nemet authored
      The previous commits moved this functionality into the client.
      
      Also remove the now unused member variable.
      
      llvm-svn: 243920
      6b6082dc
  2. Aug 03, 2015
    • Duncan P. N. Exon Smith's avatar
      Linker: Move distinct MDNodes instead of cloning · 4fb46cb8
      Duncan P. N. Exon Smith authored
      Instead of cloning distinct `MDNode`s when linking in a module, just
      move them over.  The module linker destroys the source module, so the
      old node would otherwise just be leaked on the context.  Create the new
      node in place.  This also reduces the number of cloned uniqued nodes
      (since it's less likely their operands have changed).
      
      This mapping strategy is only correct when we're discarding the source,
      so the linker turns it on via a ValueMapper flag, `RF_MoveDistinctMDs`.
      
      There's nothing observable in terms of `llvm-link` output here: the
      linked module should be semantically identical.
      
      I'll be adding more 'distinct' nodes to the debug info metadata graph in
      order to break uniquing cycles, so the benefits of this will partly come
      in future commits.  However, we should get some gains immediately, since
      we have a fair number of 'distinct' `DILocation`s being linked in.
      
      llvm-svn: 243883
      4fb46cb8
    • Duncan P. N. Exon Smith's avatar
      ValueMapper: Only check for cycles if operands change · 50f8969e
      Duncan P. N. Exon Smith authored
      This is a minor optimization to only check for unresolved operands
      inside `mapDistinctNode()` if the operands have actually changed.  This
      shouldn't really cause any change in behaviour.  I didn't actually see a
      slowdown in a profile, I was just poking around nearby and saw the
      opportunity.
      
      llvm-svn: 243866
      50f8969e
    • Duncan P. N. Exon Smith's avatar
      ValueMapper: Use a range-based for, NFC · e08bcbff
      Duncan P. N. Exon Smith authored
      llvm-svn: 243865
      e08bcbff
    • Duncan P. N. Exon Smith's avatar
      ValueMapper: Reuse local variable, NFC · 0880014d
      Duncan P. N. Exon Smith authored
      llvm-svn: 243864
      0880014d
  3. Aug 02, 2015
  4. Jul 31, 2015
  5. Jul 30, 2015
    • Adam Nemet's avatar
      [LoopVer] Add missing std::move · 252d529b
      Adam Nemet authored
      The reason I was passing this vector by value in the constructor so that
      I wouldn't have to copy when initializing the corresponding member but
      then I forgot the std::move.
      
      The use-case is LoopDistribution which filters the checks then
      std::moves it to LoopVersioning's constructor.  With this interface we
      can avoid any copies.
      
      llvm-svn: 243616
      252d529b
  6. Jul 28, 2015
    • Adam Nemet's avatar
      [LDist][LVer] Explicitly pass the set of memchecks to LoopVersioning, NFC · 0a674401
      Adam Nemet authored
      Before the patch, the checks were generated internally in
      addRuntimeCheck.  Now, we use the new overloaded version of
      addRuntimeCheck that takes the ready-made set of checks as a parameter.
      
      The checks are now generated by the client (LoopDistribution) with the
      new RuntimePointerChecking::generateChecks API.
      
      Also the new printChecks API is used to print out the checks for
      debugging.
      
      This is to continue the transition over to the new model whereby clients
      will get the full set of checks from LAA, filter it and then pass it to
      LoopVersioning and in turn to addRuntimeCheck.
      
      llvm-svn: 243382
      0a674401
  7. Jul 27, 2015
    • Sanjoy Das's avatar
      [IndVars] Make loop varying predicates loop invariant. · 5dab205c
      Sanjoy Das authored
      Summary:
      Was D9784: "Remove loop variant range check when induction variable is
      strictly increasing"
      
      This change re-implements D9784 with the two differences:
      
       1. It does not use SCEVExpander and does not generate new
          instructions.  Instead, it does a quick local search for existing
          `llvm::Value`s that it needs when modifying the `icmp`
          instruction.
      
       2. It is more general -- it deals with both increasing and decreasing
          induction variables.
      
      I've added all of the tests included with D9784, and two more.
      
      As an example on what this change does (copied from D9784):
      
      Given C code:
      
      ```
      for (int i = M; i < N; i++) // i is known not to overflow
        if (i < 0) break;
        a[i] = 0;
      }
      ```
      
      This transformation produces:
      
      ```
      for (int i = M; i < N; i++)
        if (M < 0) break;
        a[i] = 0;
      }
      ```
      
      Which can be unswitched into:
      
      ```
      if (!(M < 0))
        for (int i = M; i < N; i++)
          a[i] = 0;
      }
      ```
      
      I went back and forth on whether the top level logic should live in
      `SimplifyIndvar::eliminateIVComparison` or be put into its own
      routine.  Right now I've put it under `eliminateIVComparison` because
      even though the `icmp` is not *eliminated*, it no longer is an IV
      comparison.  I'm open to putting it in its own helper routine if you
      think that is better.
      
      Reviewers: reames, nicholas, atrick
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D11278
      
      llvm-svn: 243331
      5dab205c
  8. Jul 24, 2015
  9. Jul 23, 2015
    • Kuba Brecka's avatar
      [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check'... · 45dbffdc
      Kuba Brecka authored
      [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init'
      
      We currently version `__asan_init` and when the ABI version doesn't match, the linker gives a `undefined reference to '__asan_init_v5'` message. From this, it might not be obvious that it's actually a version mismatch error. This patch makes the error message much clearer by changing the name of the undefined symbol to be `__asan_version_mismatch_check_xxx` (followed by the version string). We obviously don't want the initializer to be named like that, so it's a separate symbol that is used only for the purpose of version checking.
      
      Reviewed at http://reviews.llvm.org/D11004
      
      llvm-svn: 243003
      45dbffdc
    • Chandler Carruth's avatar
      [PM/AA] Extract the ModRef enums from the AliasAnalysis class in · 194f59ca
      Chandler Carruth authored
      preparation for de-coupling the AA implementations.
      
      In order to do this, they had to become fake-scoped using the
      traditional LLVM pattern of a leading initialism. These can't be actual
      scoped enumerations because they're bitfields and thus inherently we use
      them as integers.
      
      I've also renamed the behavior enums that are specific to reasoning
      about the mod/ref behavior of functions when called. This makes it more
      clear that they have a very narrow domain of applicability.
      
      I think there is a significantly cleaner API for all of this, but
      I don't want to try to do really substantive changes for now, I just
      want to refactor the things away from analysis groups so I'm preserving
      the exact original design and just cleaning up the names, style, and
      lifting out of the class.
      
      Differential Revision: http://reviews.llvm.org/D10564
      
      llvm-svn: 242963
      194f59ca
  10. Jul 22, 2015
  11. Jul 15, 2015
  12. Jul 14, 2015
    • Reid Kleckner's avatar
      Update enforceKnownAlignment after the isWeakForLinker semantic change · 486fa397
      Reid Kleckner authored
      Previously we would refrain from attempting to increase the linkage of
      available_externally globals because they were considered weak for the
      linker. Now they are treated more like a declaration instead of a weak
      definition.
      
      This was causing SSE alignment faults in Chromuim, when some code
      assumed it could increase the alignment of a dllimported global that it
      didn't control.  http://crbug.com/509256
      
      llvm-svn: 242091
      486fa397
  13. Jul 11, 2015
    • Chandler Carruth's avatar
      [PM/AA] Completely remove the AliasAnalysis::copyValue interface. · 00ebdbcc
      Chandler Carruth authored
      No in-tree alias analysis used this facility, and it was not called in
      any particularly rigorous way, so it seems unlikely to be correct.
      
      Note that one of the only stateful AA implementations in-tree,
      GlobalsModRef is completely broken currently (and any AA passes like it
      are equally broken) because Module AA passes are not effectively
      invalidated when a function pass that fails to update the AA stack runs.
      
      Ultimately, it doesn't seem like we know how we want to build stateful
      AA, and until then trying to support and maintain correctness for an
      untested API is essentially impossible. To that end, I'm planning to rip
      out all of the update API. It can return if and when we need it and know
      how to build it on top of the new pass manager and as part of *tested*
      stateful AA implementations in the tree.
      
      Differential Revision: http://reviews.llvm.org/D10889
      
      llvm-svn: 241975
      00ebdbcc
  14. Jul 10, 2015
  15. Jul 01, 2015
  16. Jun 29, 2015
    • Alexey Samsonov's avatar
      [LoopSimplify] Set proper debug location in loop backedge blocks. · b7724b95
      Alexey Samsonov authored
      Set debug location for terminator instruction in loop backedge block
      (which is an unconditional jump to loop header). We can't copy debug
      location from original backedges, as there can be several of them,
      with different debug info locations. So, we follow the approach of
      SplitBlockPredecessors, and copy the debug info from first non-PHI
      instruction in the header (i.e. destination block).
      
      This is yet another change for PR23837.
      
      llvm-svn: 240999
      b7724b95
  17. Jun 26, 2015
  18. Jun 24, 2015
  19. Jun 23, 2015
  20. Jun 20, 2015
    • Benjamin Kramer's avatar
      [SwitchLowering] Remove quadratic vector removal. · 00a477f2
      Benjamin Kramer authored
      This can be triggered with giant switches. No functionality change
      intended.
      
      llvm-svn: 240221
      00a477f2
    • Justin Bogner's avatar
      LowerSwitch: Avoid some undefined behaviour · e46d3796
      Justin Bogner authored
      When a case of INT64_MIN was followed by a case that was greater than
      zero, we were overflowing a signed integer here. Since we've sorted
      the cases here anyway (and thus currentValue must be greater than
      nextValue) it's simple enough to avoid this by using addition rather
      than subtraction.
      
      Found by UBSAN on existing tests.
      
      llvm-svn: 240201
      e46d3796
  21. Jun 19, 2015
  22. Jun 18, 2015
  23. Jun 17, 2015
    • David Majnemer's avatar
      Move the personality function from LandingPadInst to Function · 7fddeccb
      David Majnemer authored
      The personality routine currently lives in the LandingPadInst.
      
      This isn't desirable because:
      - All LandingPadInsts in the same function must have the same
        personality routine.  This means that each LandingPadInst beyond the
        first has an operand which produces no additional information.
      
      - There is ongoing work to introduce EH IR constructs other than
        LandingPadInst.  Moving the personality routine off of any one
        particular Instruction and onto the parent function seems a lot better
        than have N different places a personality function can sneak onto an
        exceptional function.
      
      Differential Revision: http://reviews.llvm.org/D10429
      
      llvm-svn: 239940
      7fddeccb
    • Tyler Nowicki's avatar
      Refactor RecurrenceInstDesc · 27b2c39e
      Tyler Nowicki authored
      Moved RecurrenceInstDesc into RecurrenceDescriptor to simplify the namespaces.
      
      llvm-svn: 239862
      27b2c39e
Loading