[llvm-commits] Thread Sanitizer seems to have the dual issue

Chandler Carruth chandlerc at google.com
Thu Nov 29 01:33:42 PST 2012


On Thu, Nov 29, 2012 at 1:26 AM, Kostya Serebryany <kcc at google.com> wrote:
>
>
> On Thu, Nov 29, 2012 at 1:23 PM, Chandler Carruth <chandlerc at google.com>
> wrote:
>>
>> On Thu, Nov 29, 2012 at 1:20 AM, Chandler Carruth <chandlerc at google.com>
>> wrote:
>> > You shouldn't see any performance degradation... Just create a null
>> > pointer for the function in the pass. The first time you need it, if
>> > null, getOrInsert. Afterwards, it isn't null. The null test shouldn't
>> > matter at all.
>>
>> It occurs to me that of course, this pointer could only be used for
>> the duration of a single runOnFunction invocation. That might make it
>> less appealing as an optimization.
>
>
> Yea, a bit scary. Again, what if runOnFunction runs in parallel. This will
> become one more race to fix.
> Let me simply call getOrInsertFunction in runOnFunction...
> Ok?

Yea, either that or the compiler.used variable seems cleanest.



More information about the llvm-commits mailing list