Skip to content
  1. May 19, 2012
  2. Apr 10, 2012
    • Bill Wendling's avatar
      The MDString class stored a StringRef to the string which was already in a · c4c568b2
      Bill Wendling authored
      StringMap. This was redundant and unnecessarily bloated the MDString class.
      
      Because the MDString class is a "Value" and will never have a "name", and
      because the Name field in the Value class is a pointer to a StringMap entry, we
      repurpose the Name field for an MDString. It stores the StringMap entry in the
      Name field, and uses the normal methods to get the string (name) back.
      
      PR12474
      
      llvm-svn: 154429
      c4c568b2
  3. Apr 08, 2012
  4. Mar 15, 2012
    • Chandler Carruth's avatar
      Extend the inline cost calculation to account for bonuses due to · 4d1d34fb
      Chandler Carruth authored
      correlated pairs of pointer arguments at the callsite. This is designed
      to recognize the common C++ idiom of begin/end pointer pairs when the
      end pointer is a constant offset from the begin pointer. With the
      C-based idiom of a pointer and size, the inline cost saw the constant
      size calculation, and this provides the same level of information for
      begin/end pairs.
      
      In order to propagate this information we have to search for candidate
      operations on a pair of pointer function arguments (or derived from
      them) which would be simplified if the pointers had a known constant
      offset. Then the callsite analysis looks for such pointer pairs in the
      argument list, and applies the appropriate bonus.
      
      This helps LLVM detect that half of bounds-checked STL algorithms
      (such as hash_combine_range, and some hybrid sort implementations)
      disappear when inlined with a constant size input. However, it's not
      a complete fix due the inaccuracy of our cost metric for constants in
      general. I'm looking into that next.
      
      Benchmarks showed no significant code size change, and very minor
      performance changes. However, specific code such as hashing is showing
      significantly cleaner inlining decisions.
      
      llvm-svn: 152752
      4d1d34fb
  5. Mar 10, 2012
  6. Jan 23, 2012
  7. Dec 05, 2011
  8. Nov 15, 2011
  9. Jul 18, 2011
  10. Jul 15, 2011
  11. Jul 09, 2011
    • Chris Lattner's avatar
      Land the long talked about "type system rewrite" patch. This · b1ed91f3
      Chris Lattner authored
      patch brings numerous advantages to LLVM.  One way to look at it
      is through diffstat:
       109 files changed, 3005 insertions(+), 5906 deletions(-)
      
      Removing almost 3K lines of code is a good thing.  Other advantages
      include:
      
      1. Value::getType() is a simple load that can be CSE'd, not a mutating
         union-find operation.
      2. Types a uniqued and never move once created, defining away PATypeHolder.
      3. Structs can be "named" now, and their name is part of the identity that
         uniques them.  This means that the compiler doesn't merge them structurally
         which makes the IR much less confusing.
      4. Now that there is no way to get a cycle in a type graph without a named
         struct type, "upreferences" go away.
      5. Type refinement is completely gone, which should make LTO much MUCH faster
         in some common cases with C++ code.
      6. Types are now generally immutable, so we can use "Type *" instead 
         "const Type *" everywhere.
      
      Downsides of this patch are that it removes some functions from the C API,
      so people using those will have to upgrade to (not yet added) new API.  
      "LLVM 3.0" is the right time to do this.
      
      There are still some cleanups pending after this, this patch is large enough
      as-is.
      
      llvm-svn: 134829
      b1ed91f3
  12. Jun 23, 2011
  13. Jun 21, 2011
  14. Jun 20, 2011
    • Jay Foad's avatar
      Change how PHINodes store their operands. · e03c05c3
      Jay Foad authored
      Change PHINodes to store simple pointers to their incoming basic blocks,
      instead of full-blown Uses.
      
      Note that this loses an optimization in SplitCriticalEdge(), because we
      can no longer walk the use list of a BasicBlock to find phi nodes. See
      the comment I removed starting "However, the foreach loop is slow for
      blocks with lots of predecessors".
      
      Extend replaceAllUsesWith() on a BasicBlock to also update any phi
      nodes in the block's successors. This mimics what would have happened
      when PHINodes were proper Users of their incoming blocks. (Note that
      this only works if OldBB->replaceAllUsesWith(NewBB) is called when
      OldBB still has a terminator instruction, so it still has some
      successors.)
      
      llvm-svn: 133435
      e03c05c3
  15. Jan 23, 2011
  16. Jan 16, 2011
  17. Dec 23, 2010
  18. Dec 20, 2010
  19. Dec 18, 2010
  20. Dec 15, 2010
  21. Nov 11, 2010
    • Nick Lewycky's avatar
      Doxygenify · add50b0a
      Nick Lewycky authored
      llvm-svn: 118846
      add50b0a
    • Dan Gohman's avatar
      Factor out Instruction::isSafeToSpeculativelyExecute's code for · a826a887
      Dan Gohman authored
      testing for dereferenceable pointers into a helper function,
      isDereferenceablePointer.  Teach it how to reason about GEPs
      with simple non-zero indices.
      
      Also eliminate ArgumentPromtion's IsAlwaysValidPointer,
      which didn't check for weak externals or out of range gep
      indices.
      
      llvm-svn: 118840
      a826a887
  22. Jul 27, 2010
  23. Jul 24, 2010
  24. Jul 22, 2010
  25. Jun 28, 2010
  26. Mar 26, 2010
  27. Feb 16, 2010
  28. Jan 25, 2010
    • Bob Wilson's avatar
      Change Value::getUnderlyingObject to have the MaxLookup value specified as a · fc060e43
      Bob Wilson authored
      parameter with a default value, instead of just hardcoding it in the
      implementation.  The limit of MaxLookup = 6 was introduced in r69151 to fix
      a performance problem with O(n^2) behavior in instcombine, but the scalarrepl
      pass is relying on getUnderlyingObject to go all the way back to an AllocaInst.
      Making the limit part of the method signature makes it clear that by default
      the result is limited and should help avoid similar problems in the future.
      This fixes pr6126.
      
      llvm-svn: 94433
      fc060e43
  29. Jan 13, 2010
  30. Jan 05, 2010
  31. Dec 29, 2009
    • Chris Lattner's avatar
      When doing v1->RAUW(v2), don't do anything to metadata. We don't know · 241264ee
      Chris Lattner authored
      why one was replaced with the other.  Even in the specific case of 
      debug information, it doesn't make sense to transfer the location over,
      this will just result in jumbled loc info.
      
      llvm-svn: 92241
      241264ee
    • Chris Lattner's avatar
      This is a major cleanup of the instruction metadata interfaces that · 2f2aa2b0
      Chris Lattner authored
      I asked Devang to do back on Sep 27.  Instead of going through the
      MetadataContext class with methods like getMD() and getMDs(), just
      ask the instruction directly for its metadata with getMetadata()
      and getAllMetadata().
      
      This includes a variety of other fixes and improvements: previously
      all Value*'s were bloated because the HasMetadata bit was thrown into
      value, adding a 9th bit to a byte.  Now this is properly sunk down to
      the Instruction class (the only place where it makes sense) and it
      will be folded away somewhere soon.
      
      This also fixes some confusion in getMDs and its clients about 
      whether the returned list is indexed by the MDID or densely packed.
      This is now returned sorted and densely packed and the comments make
      this clear.
      
      This introduces a number of fixme's which I'll follow up on.
      
      llvm-svn: 92235
      2f2aa2b0
  32. Nov 01, 2009
  33. Oct 17, 2009
Loading