[llvm] r279875 - TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 17:35:11 PDT 2016


Galina Kistanova <gkistanova at gmail.com> writes:
> Hello Justin,
>
> This change made clang indeterministic.
> http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/453
>
> Could you revert it, please?

Reverted, sorry about that.

> If you would like to debug, here are some details:
>
> With this patch, 2 sequential builds of the exact same compiler produces
> different results. The .rodata sections are different in size.
> Please find attached 2 dumped section headers for clang-4.0 executable.
> Note that the size of the section [ 5] .rodata is different for each build.

Thanks for digging into this.

> Thanks
>
> Galina
>
>
> On Fri, Aug 26, 2016 at 3:29 PM, Justin Bogner via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: bogner
>> Date: Fri Aug 26 17:29:36 2016
>> New Revision: 279875
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=279875&view=rev
>> Log:
>> TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC
>>
>> This mapping is between pointers, which DenseMap is particularly good
>> at. Most targets aren't really affected, but if there's a lot of
>> subregister composition this can shave off a good chunk of time from
>> generating registers.
>>
>> Modified:
>>     llvm/trunk/utils/TableGen/CodeGenRegisters.h
>>
>> Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
>> TableGen/CodeGenRegisters.h?rev=279875&r1=279874&r2=279875&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/utils/TableGen/CodeGenRegisters.h (original)
>> +++ llvm/trunk/utils/TableGen/CodeGenRegisters.h Fri Aug 26 17:29:36 2016
>> @@ -74,8 +74,7 @@ namespace llvm {
>>      std::string getQualifiedName() const;
>>
>>      // Map of composite subreg indices.
>> -    typedef std::map<CodeGenSubRegIndex *, CodeGenSubRegIndex *,
>> -                     deref<llvm::less>> CompMap;
>> +    typedef DenseMap<CodeGenSubRegIndex *, CodeGenSubRegIndex *> CompMap;
>>
>>      // Returns the subreg index that results from composing this with Idx.
>>      // Returns NULL if this and Idx don't compose.
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>


More information about the llvm-commits mailing list