[llvm-commits] [llvm] r167942 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Nov 14 11:38:32 PST 2012


On Nov 14, 2012, at 11:35 AM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
>> From: "Jakob Stoklund Olesen" <stoklund at 2pi.dk>
>> To: "Hal Finkel" <hfinkel at anl.gov>
>> Cc: llvm-commits at cs.uiuc.edu
>> Sent: Wednesday, November 14, 2012 1:19:54 PM
>> Subject: Re: [llvm-commits] [llvm] r167942 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp
>> 
>> 
>> On Nov 14, 2012, at 10:38 AM, Hal Finkel <hfinkel at anl.gov> wrote:
>> 
>>> -      DenseMap<ValuePair, size_t> BestChildren;
>>> +      std::vector<ValuePairWithDepth> BestChildren;
>> 
>> When in doubt, use SmallVector. There are very few cases where
>> std::vector is preferable to SmallVector.
> 
> Good point. Thanks! Is one more efficient than the other when elements in the middle need to be erased?

Not as far as I know. They should behave identically except for the first allocation. (And SmallVector asserts on out-of-bound indexing).

/jakob




More information about the llvm-commits mailing list