|
1 | 1 | diff --git a/third_party/llvm/generated.patch b/third_party/llvm/generated.patch |
2 | | -<<<<<<< HEAD |
3 | | -index 776d4e6..bdba21a 100644 |
4 | | ---- a/third_party/llvm/generated.patch |
5 | | -+++ b/third_party/llvm/generated.patch |
6 | | -@@ -1,56 +1,58 @@ |
7 | | - Auto generated patch. Do not edit or delete it, even if empty. |
8 | | --diff -ruN --strip-trailing-cr a/llvm/lib/CodeGen/GlobalMerge.cpp b/llvm/lib/CodeGen/GlobalMerge.cpp |
9 | | ----- a/llvm/lib/CodeGen/GlobalMerge.cpp |
10 | | --+++ b/llvm/lib/CodeGen/GlobalMerge.cpp |
11 | | --@@ -423,12 +423,24 @@ |
12 | | -+diff -ruN --strip-trailing-cr a/lld/ELF/Config.h b/lld/ELF/Config.h |
13 | | -+--- a/lld/ELF/Config.h |
14 | | -++++ b/lld/ELF/Config.h |
15 | | -+@@ -619,7 +619,6 @@ |
16 | | -+ }; |
17 | | -+ ElfSym sym{}; |
18 | | -+ std::unique_ptr<SymbolTable> symtab; |
19 | | -+- SmallVector<Symbol *, 0> synthesizedSymbols; |
20 | | -+ |
21 | | -+ SmallVector<std::unique_ptr<MemoryBuffer>> memoryBuffers; |
22 | | -+ SmallVector<ELFFileBase *, 0> objectFiles; |
23 | | -+diff -ruN --strip-trailing-cr a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp |
24 | | -+--- a/lld/ELF/Writer.cpp |
25 | | -++++ b/lld/ELF/Writer.cpp |
26 | | -+@@ -149,7 +149,6 @@ |
27 | | -+ if (!s || s->isDefined() || s->isCommon()) |
28 | | -+ return nullptr; |
29 | | -+ |
30 | | -+- ctx.synthesizedSymbols.push_back(s); |
31 | | -+ s->resolve(ctx, Defined{ctx, ctx.internalFile, StringRef(), STB_GLOBAL, |
32 | | -+ stOther, STT_NOTYPE, val, |
33 | | -+ /*size=*/0, sec}); |
34 | | -+@@ -283,7 +282,6 @@ |
35 | | -+ static void demoteSymbolsAndComputeIsPreemptible(Ctx &ctx) { |
36 | | -+ llvm::TimeTraceScope timeScope("Demote symbols"); |
37 | | -+ DenseMap<InputFile *, DenseMap<SectionBase *, size_t>> sectionIndexMap; |
38 | | -+- bool hasDynSymTab = ctx.arg.hasDynSymTab; |
39 | | -+ for (Symbol *sym : ctx.symtab->getSymbols()) { |
40 | | -+ if (auto *d = dyn_cast<Defined>(sym)) { |
41 | | -+ if (d->section && !d->section->isLive()) |
42 | | -+@@ -296,12 +294,11 @@ |
43 | | -+ sym->type) |
44 | | -+ .overwrite(*sym); |
45 | | -+ sym->versionId = VER_NDX_GLOBAL; |
46 | | -+- if (sym->includeInDynsym(ctx)) |
47 | | -+- sym->isExported = true; |
48 | | -+ } |
49 | | - } |
50 | | -- } |
51 | | - |
52 | | --+ // Now we found a bunch of sets of globals used together. We accumulated |
53 | | --+ // the number of times we encountered the sets (i.e., the number of functions |
54 | | --+ // that use that exact set of globals). |
55 | | --+ // |
56 | | --+ // Multiply that by the size of the set to give us a crude profitability |
57 | | --+ // metric. |
58 | | --+ llvm::stable_sort(UsedGlobalSets, |
59 | | --+ [](const UsedGlobalSet &UGS1, const UsedGlobalSet &UGS2) { |
60 | | --+ return UGS1.Globals.count() * UGS1.UsageCount < |
61 | | --+ UGS2.Globals.count() * UGS2.UsageCount; |
62 | | --+ }); |
63 | | --+ |
64 | | -- // We can choose to merge all globals together, but ignore globals never used |
65 | | -- // with another global. This catches the obviously non-profitable cases of |
66 | | -- // having a single global, but is aggressive enough for any other case. |
67 | | -- if (GlobalMergeIgnoreSingleUse) { |
68 | | -- BitVector AllGlobals(Globals.size()); |
69 | | --- for (const UsedGlobalSet &UGS : UsedGlobalSets) { |
70 | | --+ for (const UsedGlobalSet &UGS : llvm::reverse(UsedGlobalSets)) { |
71 | | -- if (UGS.UsageCount == 0) |
72 | | -- continue; |
73 | | -- if (UGS.Globals.count() > 1) |
74 | | --@@ -437,16 +449,6 @@ |
75 | | -- return doMerge(Globals, AllGlobals, M, isConst, AddrSpace); |
76 | | -+- if (hasDynSymTab) |
77 | | -++ sym->isExported = sym->includeInDynsym(ctx); |
78 | | -++ if (ctx.arg.hasDynSymTab) |
79 | | -+ sym->isPreemptible = sym->isExported && computeIsPreemptible(ctx, *sym); |
80 | | -+ } |
81 | | -+ } |
82 | | -+@@ -1839,11 +1836,6 @@ |
83 | | -+ } |
84 | | - } |
85 | | - |
86 | | --- // Now we found a bunch of sets of globals used together. We accumulated |
87 | | --- // the number of times we encountered the sets (i.e., the number of functions |
88 | | --- // that use that exact set of globals). Multiply that by the size of the set |
89 | | --- // to give us a crude profitability metric. |
90 | | --- llvm::stable_sort(UsedGlobalSets, |
91 | | --- [](const UsedGlobalSet &UGS1, const UsedGlobalSet &UGS2) { |
92 | | --- return UGS1.Globals.count() * UGS1.UsageCount >= |
93 | | --- UGS2.Globals.count() * UGS2.UsageCount; |
94 | | --- }); |
95 | | -+- // If the previous code block defines any non-hidden symbols (e.g. |
96 | | -+- // __global_pointer$), they may be exported. |
97 | | -+- for (Symbol *sym : ctx.synthesizedSymbols) |
98 | | -+- sym->isExported = sym->includeInDynsym(ctx); |
99 | | - - |
100 | | -- // Starting from the sets with the best (=biggest) profitability, find a |
101 | | -- // good combination. |
102 | | -- // The ideal (and expensive) solution can only be found by trying all |
103 | | --@@ -456,7 +458,7 @@ |
104 | | -- BitVector PickedGlobals(Globals.size()); |
105 | | -- bool Changed = false; |
106 | | -+ demoteSymbolsAndComputeIsPreemptible(ctx); |
107 | | - |
108 | | --- for (const UsedGlobalSet &UGS : UsedGlobalSets) { |
109 | | --+ for (const UsedGlobalSet &UGS : llvm::reverse(UsedGlobalSets)) { |
110 | | -- if (UGS.UsageCount == 0) |
111 | | -- continue; |
112 | | -- if (PickedGlobals.anyCommon(UGS.Globals)) |
113 | | -+ if (ctx.arg.copyRelocs && ctx.arg.discard != DiscardPolicy::None) |
114 | | -diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl |
115 | | -index 6b3934d..9a336b9 100644 |
116 | | -======= |
117 | 2 | index f35b1a3..509398d 100644 |
118 | 3 | --- a/third_party/llvm/generated.patch |
119 | 4 | +++ b/third_party/llvm/generated.patch |
@@ -628,24 +513,16 @@ index f35b1a3..509398d 100644 |
628 | 513 | -+^11 = blockcount: 0 |
629 | 514 | diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl |
630 | 515 | index d2ef15d..c4a6676 100644 |
631 | | ->>>>>>> upstream/master |
632 | 516 | --- a/third_party/llvm/workspace.bzl |
633 | 517 | +++ b/third_party/llvm/workspace.bzl |
634 | 518 | @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") |
635 | 519 |
|
636 | 520 | def repo(name): |
637 | 521 | """Imports LLVM.""" |
638 | | -<<<<<<< HEAD |
639 | | -- LLVM_COMMIT = "77c780d64b950d6850d5ec1ee06cd0c21b38b89e" |
640 | | -- LLVM_SHA256 = "109bdf7b5e62992fa8ccf9445eb462b046ffc6409de859f5f7482ea3cde8f967" |
641 | | -+ LLVM_COMMIT = "2e5a5237daf82a657561c490845c406e13657311" |
642 | | -+ LLVM_SHA256 = "e0622b7f81a046e1576d8d07c5ba916346c2a1c06528655d3ddd45a1028eac89" |
643 | | -======= |
644 | 522 | - LLVM_COMMIT = "f0d05b099dafda89df4c971b64b2051c33db5da1" |
645 | 523 | - LLVM_SHA256 = "29326f27b5bffa5f57b0f8a99d3e864c09a67bf899341103a7cd609fd3ea80e3" |
646 | 524 | + LLVM_COMMIT = "386af4a5c64ab75eaee2448dc38f2e34a40bfed0" |
647 | 525 | + LLVM_SHA256 = "4b752a2dfb5e4e55cf9812a353bce7e437e0852f4eef64929f48d74732080c50" |
648 | | ->>>>>>> upstream/master |
649 | 526 |
|
650 | 527 | tf_http_archive( |
651 | 528 | name = name, |
0 commit comments