Skip to content
  1. Apr 23, 2016
    • Craig Topper's avatar
      [CodeGen] When promoting CTTZ operations to larger type, don't insert a select... · 7e5fad66
      Craig Topper authored
      [CodeGen] When promoting CTTZ operations to larger type, don't insert a select to detect if the input is zero to return the original size instead of the extended size. Instead just set the first bit in the zero extended part.
      
      llvm-svn: 267280
      7e5fad66
    • Duncan P. N. Exon Smith's avatar
      BitcodeWriter: Emit uniqued subgraphs after all distinct nodes · 30805b24
      Duncan P. N. Exon Smith authored
      Since forward references for uniqued node operands are expensive (and
      those for distinct node operands are cheap due to
      DistinctMDOperandPlaceholder), minimize forward references in uniqued
      node operands.
      
      Moreover, guarantee that when a cycle is broken by a distinct node, none
      of the uniqued nodes have any forward references.  In
      ValueEnumerator::EnumerateMetadata, enumerate uniqued node subgraphs
      first, delaying distinct nodes until all uniqued nodes have been
      handled.  This guarantees that uniqued nodes only have forward
      references when there is a uniquing cycle (since r267276 changed
      ValueEnumerator::organizeMetadata to partition distinct nodes in front
      of uniqued nodes as a post-pass).
      
      Note that a single uniqued subgraph can hit multiple distinct nodes at
      its leaves.  Ideally these would themselves be emitted in post-order,
      but this commit doesn't attempt that; I think it requires an extra pass
      through the edges, which I'm not convinced is worth it (since
      DistinctMDOperandPlaceholder makes forward references quite cheap
      between distinct nodes).
      
      I've added two testcases:
      
        - test/Bitcode/mdnodes-distinct-in-post-order.ll is just like
          test/Bitcode/mdnodes-in-post-order.ll, except with distinct nodes
          instead of uniqued ones.  This confirms that, in the absence of
          uniqued nodes, distinct nodes are still emitted in post-order.
      
        - test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll is the minimal
          example where a naive post-order traversal would cause one uniqued
          node to forward-reference another.  IOW, it's the motivating test.
      
      llvm-svn: 267278
      30805b24
    • Duncan P. N. Exon Smith's avatar
    • Duncan P. N. Exon Smith's avatar
      BitcodeWriter: Emit distinct nodes before uniqued nodes · 1483fff2
      Duncan P. N. Exon Smith authored
      When an operand of a distinct node hasn't been read yet, the reader can
      use a DistinctMDOperandPlaceholder.  This is much cheaper than forward
      referencing from a uniqued node.  Change
      ValueEnumerator::organizeMetadata to partition distinct nodes and
      uniqued nodes to reduce the overhead of cycles broken by distinct nodes.
      
      Mehdi measured this for me; this removes most of the RAUW from the
      importing step of -flto=thin, even after a WIP patch that removes
      string-based DITypeRefs (introducing many more cycles to the metadata
      graph).
      
      llvm-svn: 267276
      1483fff2
    • Teresa Johnson's avatar
      Address comments. · c814e0c1
      Teresa Johnson authored
      llvm-svn: 267274
      c814e0c1
    • Teresa Johnson's avatar
      Refactor bitcode writer into classes (NFC) · 37687f39
      Teresa Johnson authored
      Summary:
      As discussed in on the mailing list yesterday, I have refactored
      BitcodeWriter.cpp to use classes to manage the bitcode writing process,
      instead of passing around long lists of parameters between static
      functions. See:
        http://lists.llvm.org/pipermail/llvm-dev/2016-April/098610.html
      
      I created a parent BitcodeWriter class to own the BitstreamWriter,
      write the header, and contain the main entry point into the writing
      process. There are two derived classes, one for writing a module and one
      for writing a combined index file (for ThinLTO), which manage the
      writing process specific to those bitcode file types.
      
      I also changed the functions to conform to LLVM coding standards
      (lowercase function name first letter). The only two routines that still
      start with an uppercase letter are the two external interfaces, which
      can be fixed as a follow-on (I wanted to keep this round just within
      BitcodeWriter.cpp).
      
      Reviewers: dexonsmith, joker.eph
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D19447
      
      llvm-svn: 267273
      37687f39
    • Duncan P. N. Exon Smith's avatar
    • Duncan P. N. Exon Smith's avatar
      ValueEnumerator: Use std::find_if, NFC · d9bbdce7
      Duncan P. N. Exon Smith authored
      Mehdi's pattern recognition pulled this one out.  This is cleaner with
      std::find_if than with the strange helper function that took an iterator
      by reference and updated it.
      
      llvm-svn: 267271
      d9bbdce7
    • Duncan P. N. Exon Smith's avatar
      BitcodeReader: Avoid referencing unresolved nodes from distinct ones · 4b1bc647
      Duncan P. N. Exon Smith authored
      Each reference to an unresolved MDNode is expensive, since the RAUW
      support in MDNode uses a separate allocation and side map.  Since
      a distinct MDNode doesn't require its operands on creation (unlike
      uniuqed nodes, there's no need to check for structural equivalence),
      use nullptr for any of its unresolved operands.  Besides reducing the
      burden on MDNode maps, this can avoid allocating temporary MDNodes in
      the first place.
      
      We need some way to track operands.  Invent DistinctMDOperandPlaceholder
      for this purpose, which is a Metadata subclass that holds an ID and
      points at its single user.  DistinctMDOperandPlaceholder::replaceUseWith
      is just like RAUW, but its name highlights that there is only ever
      exactly one use.
      
      There is no support for moving (or, obviously, copying) these.  Move
      support would be possible but expensive; leaving it unimplemented
      prevents user error.  In the BitcodeReader I originally considered
      allocating on a BumpPtrAllocator and keeping a vector of pointers to
      them, and then I realized that std::deque implements exactly this.
      
      A couple of obvious follow-ups:
      
        - Change ValueEnumerator to emit distinct nodes first to take more
          advantage of this optimization.  (How convenient... I think I might
          have a couple of patches for this.)
      
        - Change DIBuilder and its consumers (like CGDebugInfo in clang) to
          use something like this when constructing debug info in the first
          place.
      
      llvm-svn: 267270
      4b1bc647
    • Duncan P. N. Exon Smith's avatar
      BitcodeReader: Consistently use IsDistinct, NFC · 30ab4b47
      Duncan P. N. Exon Smith authored
      Consistently use the IsDistinct variable and start relying on it in
      GET_OR_DISTINCT.  This change has NFC, but prepares for using IsDistinct
      to optimize the behaviour of the getMD() and getMDOrNull() helpers.
      
      llvm-svn: 267268
      30ab4b47
    • Duncan P. N. Exon Smith's avatar
      BitcodeReader: Use getMD/getMDOrNull helpers consistently, almost NFC · 004509dc
      Duncan P. N. Exon Smith authored
      The only functionality change was removing an error check from the
      BitcodeReader (and an assertion from DILocation::getImpl) that is
      already caught by Verifier::visitDILocation.  The Verifier is a better
      place for this anyway, and being inconsistent with other subclasses of
      MDNode isn't serving anyone.
      
      llvm-svn: 267267
      004509dc
    • Craig Topper's avatar
      [Hexagon] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will... · 6e6a1f0a
      Craig Topper authored
      [Hexagon] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will convert them to ctlz/cttz. Remove the now unneccessary isel patterns. NFC
      
      llvm-svn: 267266
      6e6a1f0a
    • Craig Topper's avatar
      [NVPTX] Set ctlz_zero_undef to Expand so LegalizeDAG will convert it to ctlz.... · 6f8b8e4c
      Craig Topper authored
      [NVPTX] Set ctlz_zero_undef to Expand so LegalizeDAG will convert it to ctlz. Remove the now unneccessary isel patterns. NFC
      
      llvm-svn: 267265
      6f8b8e4c
    • Craig Topper's avatar
      [WebAssembly] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG... · b297b6b0
      Craig Topper authored
      [WebAssembly] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will convert them to ctlz/cttz. Remove the now unneccessary isel patterns. NFC
      
      llvm-svn: 267264
      b297b6b0
    • Amaury Sechet's avatar
      Style fix in Core.h / Core.cpp. NFC · b130f43b
      Amaury Sechet authored
      llvm-svn: 267257
      b130f43b
    • Tim Northover's avatar
      MachO: remove weird ARM/Thumb interface from MachOObjectFile · 9e8eb418
      Tim Northover authored
      Only one consumer (llvm-objdump) actually cared about the fact that there were
      two triples. Others were actively working around the fact that the Triple
      returned by getArch might have been invalid. As for llvm-objdump, it needs to
      be acutely aware of both Triples anyway, so being generic in the exposed API is
      no benefit.
      
      Also rename the version of getArch returning a Triple. Users were having to
      pass an unwanted nullptr to disambiguate the two, which was nasty.
      
      The only functional change here is that armv7m and armv7em object files no
      longer crash llvm-objdump.
      
      llvm-svn: 267249
      9e8eb418
    • Matt Arsenault's avatar
      AMDGPU: sext_inreg (srl x, K), vt -> bfe x, K, vt.Size · 7e8de01f
      Matt Arsenault authored
      llvm-svn: 267244
      7e8de01f
    • David Blaikie's avatar
      llvm-symbolizer: Avoid infinite recursion walking dwos where the dwo contains a dwo_name attribute · e438cff4
      David Blaikie authored
      The dwo_name was added to dwo files to improve diagnostics in dwp, but
      it confuses tools that attempt to load any dwo named by a dwo_name, even
      ones inside dwos. Avoid this by keeping track of whether a unit is
      already a dwo unit, and if so, not loading further dwos.
      
      llvm-svn: 267241
      e438cff4
    • Matt Arsenault's avatar
      AMDGPU: Re-visit nodes in performAndCombine · efa3fe14
      Matt Arsenault authored
      This fixes test regressions when i64 loads/stores are made promote.
      
      llvm-svn: 267240
      efa3fe14
    • Andrew Kaylor's avatar
      Removing unused function. · 79a933a6
      Andrew Kaylor authored
      llvm-svn: 267236
      79a933a6
    • Nico Weber's avatar
      Revert r267210, it makes clang assert (PR27490). · 0aa9845d
      Nico Weber authored
      llvm-svn: 267232
      0aa9845d
    • Andrew Kaylor's avatar
      Re-commit optimization bisect support (r267022) without new pass manager support. · aa641a51
      Andrew Kaylor authored
      The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling).
      
      Differential Revision: http://reviews.llvm.org/D19172
      
      llvm-svn: 267231
      aa641a51
  2. Apr 22, 2016
Loading