[llvm-dev] How to use map/set in LLVM to disable automatic sorting?

Jonathan Roelofs via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 25 11:15:17 PDT 2016



On 7/25/16 1:19 AM, ZhaoKang via llvm-dev wrote:
> Hello LLVM,
>
>
> We found that many LLVM passes use map/set containers to increase the
> searching efficiency.
>
> Although map/set has automatic sorting feature, the results after the
> same pass transformation are still the same.
>
> If native map/set, we think the order after inserting new element may
> change.
>
> So, my question is, does LLVM use its own-defined structure instead of
> native map/set?

Yes, in places where iteration order matters, we try really hard to use 
ADT's that have a deterministic iteration order, so that the passes 
themselves remain deterministic.

See: 
http://llvm.org/docs/ProgrammersManual.html#picking-the-right-data-structure-for-a-task


Jon

> Or, LLVM disables such feature for map/set?
>
> Could you give a detailed explanation?
>
> Thanks!
>
>
>
> Kang
>
>
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded


More information about the llvm-dev mailing list