Displaying 4 results from an estimated 4 matches for "ordermap".
2017 Jul 31
3
[RFC] Profile guided section layout
Hi Rafael,
On 07/31/2017 04:20 PM, Rafael Avila de Espindola via llvm-dev wrote:
> However, do we need to start with instrumentation? The original paper
> uses sampling with good results and current intel cpus can record every
> branch in a program.
>
> I would propose starting with just an lld patch that reads the call
> graph from a file. The format would be very similar to
2017 Jul 31
2
[RFC] Profile guided section layout
...+ // Sort by density.
+ std::sort(Nodes.begin(), Nodes.end(), [](const Node &A, const Node &B) {
+ return double(A.Weight) / double(A.Size) <
+ double(B.Weight) / double(B.Size);
+ });
+
+ // Generate order.
+ llvm::DenseMap<const InputSectionBase *, std::size_t> OrderMap;
+ ssize_t CurOrder = 0;
+
+ for (const Node &N : Nodes) {
+ if (N.Sections.empty())
+ continue;
+ for (const InputSectionBase *IS : N.Sections)
+ OrderMap[IS] = CurOrder++;
+ }
+
+ for (OutputSection *OS : OutputSections) {
+ if (OS->Name != ".text")
+...
2017 Jun 15
7
[RFC] Profile guided section layout
...+ // Sort by density.
+ std::sort(Nodes.begin(), Nodes.end(), [](const Node &A, const Node &B) {
+ return double(A.Weight) / double(A.Size) <
+ double(B.Weight) / double(B.Size);
+ });
+
+ // Generate order.
+ llvm::DenseMap<const InputSectionBase *, std::size_t> OrderMap;
+ ssize_t CurOrder = 0;
+
+ for (const Node &N : Nodes) {
+ if (N.Sections.empty())
+ continue;
+ for (const InputSectionBase *IS : N.Sections)
+ OrderMap[IS] = CurOrder++;
+ }
+
+ for (OutputSection *OS : OutputSections) {
+ if (OS->Name != ".text")
+...
2017 Aug 01
2
[RFC] Profile guided section layout
...+ // Sort by density.
+ std::sort(Nodes.begin(), Nodes.end(), [](const Node &A, const Node &B) {
+ return double(A.Weight) / double(A.Size) <
+ double(B.Weight) / double(B.Size);
+ });
+
+ // Generate order.
+ llvm::DenseMap<const InputSectionBase *, std::size_t> OrderMap;
+ ssize_t CurOrder = 0;
+
+ for (const Node &N : Nodes) {
+ if (N.Sections.empty())
+ continue;
+ for (const InputSectionBase *IS : N.Sections)
+ OrderMap[IS] = CurOrder++;
+ }
+ for (BaseCommand *Base : Script->Opt.Commands) {
+ auto *OS = dyn_cast<OutputSection&g...