[llvm-commits] [llvm] r97759 - /llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
Dan Gohman
gohman at apple.com
Thu Mar 4 18:19:19 PST 2010
On Mar 4, 2010, at 5:06 PM, Chris Lattner wrote:
>
> On Mar 4, 2010, at 4:55 PM, Jeffrey Yasskin wrote:
>
>>>>
>>>> PseudoSourceValue::getFixedStack lets the user pass in an arbitrary
>>>> int. It could be that these tend to be dense, allowing us to use a
>>>> vector for FSValues instead of the map, but the vector would still
>>>> have to be growable to accommodate larger integers than it's seen yet,
>>>> which would still require a lock. Since I don't know how this is used,
>>>> I just rearranged it instead of trying to change the data structure or
>>>> move it into the Context.
>>>
>>> Ah, I see. Dan, what do you think? a lock + std::map seems expensive.
>>
>> Another way to avoid the lock would be to contextify this. It probably
>> wouldn't be that hard; just require an extra parameter everywhere it's
>> used.
>
> I think that is a much better solution :), though I don't know how hot this really is.
I suspect it's not super hot.
Contextifying PseudoSourceValues could be considered a layering violation,
since they are a CodeGen-specific data structure. Maybe MachineFunction
could own these things.
Dan
More information about the llvm-commits
mailing list