[LLVMdev] SIV tests in LoopDependence Analysis, Sanjoy's patch
Preston Briggs
preston.briggs at gmail.com
Wed Apr 4 18:46:35 PDT 2012
I wrote:
>> private:
>> Value *source, *destination;
>> Kind kind;
>> SmallVector<const Level *, 4> levels;
> I'd malloc an ordinary vector of the appropriate length,
> since we know the length at allocation time.
and Duncan Sands replied:
> if the number of levels is usually small it is usually better to use a
> SmallVector (like in the code above) and do:
> levels.reserve(known_size);
> That way you avoid a malloc if known_size <= 4.
Surely faster, but what about the space impact, especially if the size
is 0 or 1?
Do we care? I have several ideas to save space, but there's almost always
a time cost. I worry, being afraid we'll need to represent many, many
dependences.
Thanks,
Preston
More information about the llvm-dev
mailing list