Skip to content
  1. Jun 17, 2012
    • Chandler Carruth's avatar
      Disable a particular assertion on MSVC... I'm deeply disturbed by its · d599a8c4
      Chandler Carruth authored
      implementation of the class layout for the V8 type.
      
      llvm-svn: 158640
      d599a8c4
    • Chandler Carruth's avatar
      Add tests for *DenesMap for both key and value types' construction and · a1be842f
      Chandler Carruth authored
      destruction and fix a bug in SmallDenseMap they caught.
      
      This is kind of a poor-man's version of the testing that just adds the
      addresses to a set on construction and removes them on destruction. We
      check that double construction and double destruction don't occur.
      Amusingly enough, this is enough to catch a lot of SmallDenseMap issues
      because we spend a lot of time with fixed stable addresses in the inline
      buffer.
      
      The SmallDenseMap bug fix included makes grow() not double-destroy in
      some cases. It also fixes a FIXME there, the code was pretty crappy. We
      now don't have any wasted initialization, but we do move the entries in
      inline bucket array an extra time. It's probably a better tradeoff, and
      is much easier to get correct.
      
      llvm-svn: 158639
      a1be842f
    • Chandler Carruth's avatar
      Introduce a SmallDenseMap container that re-uses the existing DenseMap · 20dd838a
      Chandler Carruth authored
      implementation.
      
      This type includes an inline bucket array which is used initially. Once
      it is exceeded, an array of 64 buckets is allocated on the heap. The
      bucket count grows from there as needed. Some highlights of this
      implementation:
      
      - The inline buffer is very carefully aligned, and so supports types
        with alignment constraints.
      - It works hard to avoid aliasing issues.
      - Supports types with non-trivial constructors, destructors, copy
        constructions, etc. It works reasonably hard to minimize copies and
        unnecessary initialization. The most common initialization is to set
        keys to the empty key, and so that should be fast if at all possible.
      
      This class has a performance / space trade-off. It tries to optimize for
      relatively small maps, and so packs the inline bucket array densely into
      the object. It will be marginally slower than a normal DenseMap in a few
      use patterns, so it isn't appropriate everywhere.
      
      The unit tests for DenseMap have been generalized a bit to support
      running over different map implementations in addition to different
      key/value types. They've then been automatically extended to cover the
      new container through the magic of GoogleTest's typed tests.
      
      All of this is still a bit rough though. I'm going to be cleaning up
      some aspects of the implementation, documenting things better, and
      adding tests which include non-trivial types. As soon as I'm comfortable
      with the correctness, I plan to switch existing users of SmallMap over
      to this class as it is already more correct w.r.t. construction and
      destruction of objects iin the map.
      
      Thanks to Benjamin Kramer for all the reviews of this and the lead-up
      patches. That said, more review on this would really be appreciated. As
      I've noted a few times, I'm quite surprised how hard it is to get the
      semantics for a hashtable-based map container with a small buffer
      optimization correct. =]
      
      llvm-svn: 158638
      20dd838a
    • Chandler Carruth's avatar
      Add some somewhat exhaustive tests of sizeof properties of this horrible · a4d40753
      Chandler Carruth authored
      construct just for my sanity.
      
      llvm-svn: 158637
      a4d40753
    • Pete Cooper's avatar
      Now that SROA can form alloca's for dynamic vector accesses, further improve... · 33ee6c9b
      Pete Cooper authored
      Now that SROA can form alloca's for dynamic vector accesses, further improve it to be able to replace operations on these vector alloca's with insert/extract element insts
      
      llvm-svn: 158623
      33ee6c9b
  2. Jun 16, 2012
  3. Jun 15, 2012
Loading