Bug 1605560 - Move to clang 9.0.1 r=froydnj
authorSylvestre Ledru <sledru@mozilla.com>
Sun, 22 Dec 2019 21:57:04 +0000
changeset 508507 963bed108e6206bf23b4d27d5bd029b1a6160c81
parent 508506 18efdddf6b5ade243f120487fe0a9375f75b2a48
child 508508 7e9830f213c8606a30d7c4f6cdc248e1e1041a39
push id104036
push usersledru@mozilla.com
push dateMon, 30 Dec 2019 20:01:57 +0000
treeherderautoland@963bed108e62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1605560
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1605560 - Move to clang 9.0.1 r=froydnj remove patch "r372020-r372182-profiler-linkage.patch" as it is now applied upstream in the branch 9: https://github.com/llvm/llvm-project/commit/99e5b1a41a89cda929d0295d3b6f1519a114d808#diff-74ce7383b15a6fad853c8677f58da28a Differential Revision: https://phabricator.services.mozilla.com/D58076
build/build-clang/clang-linux64-cross.json
build/build-clang/clang-win64.json
build/build-clang/r372020-r372182-profiler-linkage.patch
taskcluster/ci/fetch/toolchains.yml
--- a/build/build-clang/clang-linux64-cross.json
+++ b/build/build-clang/clang-linux64-cross.json
@@ -11,12 +11,11 @@
     "as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
     "patches": [
       "static-llvm-symbolizer.patch",
       "find_symbolizer_linux.patch",
       "rename_gcov_flush.patch",
       "critical_section_on_gcov_flush-rG02ce9d8ef5a8.patch",
       "android-mangling-error.patch",
       "revert-r359260-due-to-bug41817.patch",
-      "r372020-r372182-profiler-linkage.patch",
       "rG7e18aeba5062.patch"
     ]
 }
--- a/build/build-clang/clang-win64.json
+++ b/build/build-clang/clang-win64.json
@@ -5,14 +5,13 @@
     "assertions": false,
     "python_path": "c:/mozilla-build/python/python.exe",
     "cc": "cl.exe",
     "cxx": "cl.exe",
     "ml": "ml64.exe",
     "patches": [
       "unpoison-thread-stacks.patch",
       "downgrade-mangling-error.patch",
-      "r372020-r372182-profiler-linkage.patch",
       "revert-r359260-due-to-bug41817.patch",
       "rG7e18aeba5062.patch",
       "loosen-msvc-detection.patch"
     ]
 }
deleted file mode 100644
--- a/build/build-clang/r372020-r372182-profiler-linkage.patch
+++ /dev/null
@@ -1,130 +0,0 @@
---- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
-+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
-@@ -731,9 +731,8 @@
-     PD = It->second;
-   }
- 
--  // Match the linkage and visibility of the name global, except on COFF, where
--  // the linkage must be local and consequentially the visibility must be
--  // default.
-+  // Match the linkage and visibility of the name global. COFF supports using
-+  // comdats with internal symbols, so do that if we can.
-   Function *Fn = Inc->getParent()->getParent();
-   GlobalValue::LinkageTypes Linkage = NamePtr->getLinkage();
-   GlobalValue::VisibilityTypes Visibility = NamePtr->getVisibility();
-@@ -749,19 +748,25 @@
-   // new comdat group for the counters and profiling data. If we use the comdat
-   // of the parent function, that will result in relocations against discarded
-   // sections.
--  Comdat *Cmdt = nullptr;
--  GlobalValue::LinkageTypes CounterLinkage = Linkage;
--  if (needsComdatForCounter(*Fn, *M)) {
--    StringRef CmdtPrefix = getInstrProfComdatPrefix();
-+  bool NeedComdat = needsComdatForCounter(*Fn, *M);
-+  Comdat *Cmdt = nullptr; // Comdat group.
-+  if (NeedComdat) {
-     if (TT.isOSBinFormatCOFF()) {
--      // For COFF, the comdat group name must be the name of a symbol in the
--      // group. Use the counter variable name, and upgrade its linkage to
--      // something externally visible, like linkonce_odr.
--      CmdtPrefix = getInstrProfCountersVarPrefix();
--      CounterLinkage = GlobalValue::LinkOnceODRLinkage;
-+      // For COFF, put the counters, data, and values each into their own
-+      // comdats. We can't use a group because the Visual C++ linker will
-+      // report duplicate symbol errors if there are multiple external symbols
-+      // with the same name marked IMAGE_COMDAT_SELECT_ASSOCIATIVE.
-+      Linkage = GlobalValue::LinkOnceODRLinkage;
-+      Visibility = GlobalValue::HiddenVisibility;
-+    } else {
-+      // Otherwise, create one comdat group for everything.
-+      Cmdt = M->getOrInsertComdat(getVarName(Inc, getInstrProfComdatPrefix()));
-     }
--    Cmdt = M->getOrInsertComdat(getVarName(Inc, CmdtPrefix));
-   }
-+  auto MaybeSetComdat = [=](GlobalVariable *GV) {
-+    if (NeedComdat)
-+      GV->setComdat(Cmdt ? Cmdt : M->getOrInsertComdat(GV->getName()));
-+  };
- 
-   uint64_t NumCounters = Inc->getNumCounters()->getZExtValue();
-   LLVMContext &Ctx = M->getContext();
-@@ -776,8 +781,8 @@
-   CounterPtr->setSection(
-       getInstrProfSectionName(IPSK_cnts, TT.getObjectFormat()));
-   CounterPtr->setAlignment(8);
--  CounterPtr->setComdat(Cmdt);
--  CounterPtr->setLinkage(CounterLinkage);
-+  MaybeSetComdat(CounterPtr);
-+  CounterPtr->setLinkage(Linkage);
- 
-   auto *Int8PtrTy = Type::getInt8PtrTy(Ctx);
-   // Allocate statically the array of pointers to value profile nodes for
-@@ -798,7 +803,7 @@
-       ValuesVar->setSection(
-           getInstrProfSectionName(IPSK_vals, TT.getObjectFormat()));
-       ValuesVar->setAlignment(8);
--      ValuesVar->setComdat(Cmdt);
-+      MaybeSetComdat(ValuesVar);
-       ValuesPtrExpr =
-           ConstantExpr::getBitCast(ValuesVar, Type::getInt8PtrTy(Ctx));
-     }
-@@ -831,7 +836,8 @@
-   Data->setVisibility(Visibility);
-   Data->setSection(getInstrProfSectionName(IPSK_data, TT.getObjectFormat()));
-   Data->setAlignment(INSTR_PROF_DATA_ALIGNMENT);
--  Data->setComdat(Cmdt);
-+  MaybeSetComdat(Data);
-+  Data->setLinkage(Linkage);
- 
-   PD.RegionCounters = CounterPtr;
-   PD.DataVar = Data;
---- a/llvm/test/Instrumentation/InstrProfiling/PR23499.ll
-+++ b/llvm/test/Instrumentation/InstrProfiling/PR23499.ll
-@@ -20,8 +20,8 @@
- 
- 
- ; COFF-NOT: __profn__Z3barIvEvv
--; COFF: @__profc__Z3barIvEvv = linkonce_odr dso_local global [1 x i64] zeroinitializer, section "{{.*}}prfc$M", comdat, align 8
--; COFF: @__profd__Z3barIvEvv = internal global { i64, i64, i64*, i8*, i8*, i32, [2 x i16] } { i64 4947693190065689389, i64 0, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc__Z3barIvEvv, i32 0, i32 0), i8*{{.*}}, i8* null, i32 1, [2 x i16] zeroinitializer }, section "{{.*}}prfd{{.*}}", comdat($__profc__Z3barIvEvv), align 8
-+; COFF: @__profc__Z3barIvEvv = linkonce_odr hidden global [1 x i64] zeroinitializer, section "{{.*}}prfc$M", comdat, align 8
-+; COFF: @__profd__Z3barIvEvv = linkonce_odr hidden global { i64, i64, i64*, i8*, i8*, i32, [2 x i16] } { i64 4947693190065689389, i64 0, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc__Z3barIvEvv, i32 0, i32 0), i8*{{.*}}, i8* null, i32 1, [2 x i16] zeroinitializer }, section "{{.*}}prfd{{.*}}", comdat, align 8
- 
- 
- declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #1
---- a/llvm/test/Instrumentation/InstrProfiling/comdat.ll
-+++ b/llvm/test/Instrumentation/InstrProfiling/comdat.ll
-@@ -17,8 +17,8 @@
- 
- ; ELF: @__profc_foo_inline = linkonce_odr hidden global{{.*}}, section "__llvm_prf_cnts", comdat($__profv_foo_inline), align 8
- ; ELF: @__profd_foo_inline = linkonce_odr hidden global{{.*}}, section "__llvm_prf_data", comdat($__profv_foo_inline), align 8
--; COFF: @__profc_foo_inline = linkonce_odr dso_local global{{.*}}, section ".lprfc$M", comdat, align 8
--; COFF: @__profd_foo_inline = internal global{{.*}}, section ".lprfd$M", comdat($__profc_foo_inline), align 8
-+; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}}, section ".lprfc$M", comdat, align 8
-+; COFF: @__profd_foo_inline = linkonce_odr hidden global{{.*}}, section ".lprfd$M", comdat, align 8
- define weak_odr void @foo_inline() comdat {
-   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
-   ret void
-@@ -30,8 +30,8 @@
- 
- ; ELF: @__profc_foo_extern = linkonce_odr hidden global{{.*}}, section "__llvm_prf_cnts", comdat($__profv_foo_extern)
- ; ELF: @__profd_foo_extern = linkonce_odr hidden global{{.*}}, section "__llvm_prf_data", comdat($__profv_foo_extern)
--; COFF: @__profc_foo_extern = linkonce_odr dso_local global{{.*}}, section ".lprfc$M", comdat, align 8
--; COFF: @__profd_foo_extern = internal global{{.*}}, section ".lprfd$M", comdat($__profc_foo_extern), align 8
-+; COFF: @__profc_foo_extern = linkonce_odr hidden global{{.*}}, section ".lprfc$M", comdat, align 8
-+; COFF: @__profd_foo_extern = linkonce_odr hidden global{{.*}}, section ".lprfd$M", comdat, align 8
- define available_externally void @foo_extern() {
-   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
-   ret void
---- a/llvm/test/Instrumentation/InstrProfiling/linkage.ll
-+++ b/llvm/test/Instrumentation/InstrProfiling/linkage.ll
-@@ -57,8 +57,8 @@
- ; LINUX: @__profd_foo_extern = linkonce_odr hidden global {{.*}}section "__llvm_prf_data", comdat($__profv_foo_extern), align 8
- ; MACHO: @__profc_foo_extern = linkonce_odr hidden global
- ; MACHO: @__profd_foo_extern = linkonce_odr hidden global
--; COFF: @__profc_foo_extern = linkonce_odr dso_local global {{.*}}section ".lprfc$M", comdat, align 8
--; COFF: @__profd_foo_extern = internal global {{.*}}section ".lprfd$M", comdat($__profc_foo_extern), align 8
-+; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfc$M", comdat, align 8
-+; COFF: @__profd_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfd$M", comdat, align 8
- define available_externally void @foo_extern() {
-   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
-   ret void
--- a/taskcluster/ci/fetch/toolchains.yml
+++ b/taskcluster/ci/fetch/toolchains.yml
@@ -404,21 +404,21 @@ clang-7:
 clang-8:
     description: clang 8.0.1 source code
     fetch:
         type: git
         repo: https://github.com/llvm/llvm-project
         revision: 19a71f6bdf2dddb10764939e7f0ec2b98dba76c9
 
 clang-9:
-    description: clang 9.0.0 source code
+    description: clang 9.0.1 source code
     fetch:
         type: git
         repo: https://github.com/llvm/llvm-project
-        revision: 0399d5a9682b3cef71c653373e38890c63c4c365
+        revision: c1a0a213378a458fbea1a5c77b315c7dce08fd05
 
 wasi-sdk:
     description: wasi-sdk source code
     fetch:
         type: git
         repo: https://github.com/CraneStation/wasi-sdk
         revision: 5225b05436ce57f01fe649f411f3ff701246628b