[llvm] r252563 - [PGO] Make indexed value profile data more compact
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 21 11:26:16 PST 2016
I haven't seen a failure yet, this is a latent issue.
AFAICT mutable static variables are generally avoided in llvm. We use llvm::ManagedStatic with atomics or locking if absolutely necessary.
Could you move this field into InstrProfWriter and InstrProfRecordTraits?
vedant
> On Jan 21, 2016, at 9:58 AM, Xinliang David Li <davidxl at google.com> wrote:
>
> The setter call is invoked only in a unittest. Can you send me the
> failure report? (currently InstrProfRecordTraits has no members and is
> stateless).
>
> thanks,
>
> David
>
> On Thu, Jan 21, 2016 at 1:17 AM, Vedant Kumar <vsk at apple.com> wrote:
>> Hi David,
>>
>>> namespace {
>>> +static support::endianness ValueProfDataEndianness = support::little;
>>> +// Internal interface for testing purpose only.
>>> +void InstrProfWriter::setValueProfDataEndianness(
>>> + support::endianness Endianness) {
>>> + ValueProfDataEndianness = Endianness;
>>> +}
>>
>>
>> Please remove this static variable. It breaks clients who use llvm in a multi-threaded environment.
>>
>> thanks
>> vedant
>>
More information about the llvm-commits
mailing list