Date: Tue, 11 Jun 2019 18:16:50 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r348934 - in vendor/clang/dist-release_80: lib/Basic lib/CodeGen lib/Driver/ToolChains lib/Sema test/Driver test/OpenMP Message-ID: <201906111816.x5BIGojU037373@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Tue Jun 11 18:16:50 2019 New Revision: 348934 URL: https://svnweb.freebsd.org/changeset/base/348934 Log: Vendor import of clang release_80 branch r363030: https://llvm.org/svn/llvm-project/cfe/branches/release_80@363030 Modified: vendor/clang/dist-release_80/lib/Basic/Version.cpp vendor/clang/dist-release_80/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist-release_80/lib/Driver/ToolChains/Linux.cpp vendor/clang/dist-release_80/lib/Sema/SemaOpenMP.cpp vendor/clang/dist-release_80/test/Driver/cl-options.c vendor/clang/dist-release_80/test/Driver/instrprof-ld.c vendor/clang/dist-release_80/test/Driver/linux-ld.c vendor/clang/dist-release_80/test/OpenMP/ordered_doacross_codegen.cpp Modified: vendor/clang/dist-release_80/lib/Basic/Version.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Basic/Version.cpp Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/lib/Basic/Version.cpp Tue Jun 11 18:16:50 2019 (r348934) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_800/final/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_80/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: vendor/clang/dist-release_80/lib/CodeGen/CGStmtOpenMP.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/CodeGen/CGStmtOpenMP.cpp Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/lib/CodeGen/CGStmtOpenMP.cpp Tue Jun 11 18:16:50 2019 (r348934) @@ -1518,8 +1518,9 @@ void CodeGenFunction::EmitOMPPrivateLoopCounters( I < E; ++I) { const auto *DRE = cast<DeclRefExpr>(C->getLoopCounter(I)); const auto *VD = cast<VarDecl>(DRE->getDecl()); - // Override only those variables that are really emitted already. - if (LocalDeclMap.count(VD)) { + // Override only those variables that can be captured to avoid re-emission + // of the variables declared within the loops. + if (DRE->refersToEnclosingVariableOrCapture()) { (void)LoopScope.addPrivate(VD, [this, DRE, VD]() { return CreateMemTemp(DRE->getType(), VD->getName()); }); Modified: vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/lib/Driver/ToolChains/Clang.cpp Tue Jun 11 18:16:50 2019 (r348934) @@ -718,8 +718,9 @@ static void appendUserToPath(SmallVectorImpl<char> &Re Result.append(UID.begin(), UID.end()); } -static void addPGOAndCoverageFlags(Compilation &C, const Driver &D, - const InputInfo &Output, const ArgList &Args, +static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C, + const Driver &D, const InputInfo &Output, + const ArgList &Args, ArgStringList &CmdArgs) { auto *PGOGenerateArg = Args.getLastArg(options::OPT_fprofile_generate, @@ -759,6 +760,11 @@ static void addPGOAndCoverageFlags(Compilation &C, con ProfileGenerateArg->getValue())); // The default is to use Clang Instrumentation. CmdArgs.push_back("-fprofile-instrument=clang"); + if (TC.getTriple().isWindowsMSVCEnvironment()) { + // Add dependent lib for clang_rt.profile + CmdArgs.push_back(Args.MakeArgString("--dependent-lib=" + + TC.getCompilerRT(Args, "profile"))); + } } if (PGOGenerateArg) { @@ -4118,7 +4124,7 @@ void Clang::ConstructJob(Compilation &C, const JobActi // sampling, overhead of call arc collection is way too high and there's no // way to collect the output. if (!Triple.isNVPTX()) - addPGOAndCoverageFlags(C, D, Output, Args, CmdArgs); + addPGOAndCoverageFlags(TC, C, D, Output, Args, CmdArgs); if (auto *ABICompatArg = Args.getLastArg(options::OPT_fclang_abi_compat_EQ)) ABICompatArg->render(Args, CmdArgs); Modified: vendor/clang/dist-release_80/lib/Driver/ToolChains/Linux.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Driver/ToolChains/Linux.cpp Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/lib/Driver/ToolChains/Linux.cpp Tue Jun 11 18:16:50 2019 (r348934) @@ -45,6 +45,7 @@ static std::string getMultiarchTriple(const Driver &D, TargetTriple.getEnvironment(); bool IsAndroid = TargetTriple.isAndroid(); bool IsMipsR6 = TargetTriple.getSubArch() == llvm::Triple::MipsSubArch_r6; + bool IsMipsN32Abi = TargetTriple.getEnvironment() == llvm::Triple::GNUABIN32; // For most architectures, just use whatever we have rather than trying to be // clever. @@ -103,33 +104,37 @@ static std::string getMultiarchTriple(const Driver &D, return "aarch64_be-linux-gnu"; break; case llvm::Triple::mips: { - std::string Arch = IsMipsR6 ? "mipsisa32r6" : "mips"; - if (D.getVFS().exists(SysRoot + "/lib/" + Arch + "-linux-gnu")) - return Arch + "-linux-gnu"; + std::string MT = IsMipsR6 ? "mipsisa32r6-linux-gnu" : "mips-linux-gnu"; + if (D.getVFS().exists(SysRoot + "/lib/" + MT)) + return MT; break; } case llvm::Triple::mipsel: { if (IsAndroid) return "mipsel-linux-android"; - std::string Arch = IsMipsR6 ? "mipsisa32r6el" : "mipsel"; - if (D.getVFS().exists(SysRoot + "/lib/" + Arch + "-linux-gnu")) - return Arch + "-linux-gnu"; + std::string MT = IsMipsR6 ? "mipsisa32r6el-linux-gnu" : "mipsel-linux-gnu"; + if (D.getVFS().exists(SysRoot + "/lib/" + MT)) + return MT; break; } case llvm::Triple::mips64: { - std::string Arch = IsMipsR6 ? "mipsisa64r6" : "mips64"; - std::string ABI = llvm::Triple::getEnvironmentTypeName(TargetEnvironment); - if (D.getVFS().exists(SysRoot + "/lib/" + Arch + "-linux-" + ABI)) - return Arch + "-linux-" + ABI; + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6" : "mips64") + + "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); + if (D.getVFS().exists(SysRoot + "/lib/" + MT)) + return MT; + if (D.getVFS().exists(SysRoot + "/lib/mips64-linux-gnu")) + return "mips64-linux-gnu"; break; } case llvm::Triple::mips64el: { if (IsAndroid) return "mips64el-linux-android"; - std::string Arch = IsMipsR6 ? "mipsisa64r6el" : "mips64el"; - std::string ABI = llvm::Triple::getEnvironmentTypeName(TargetEnvironment); - if (D.getVFS().exists(SysRoot + "/lib/" + Arch + "-linux-" + ABI)) - return Arch + "-linux-" + ABI; + std::string MT = std::string(IsMipsR6 ? "mipsisa64r6el" : "mips64el") + + "-linux-" + (IsMipsN32Abi ? "gnuabin32" : "gnuabi64"); + if (D.getVFS().exists(SysRoot + "/lib/" + MT)) + return MT; + if (D.getVFS().exists(SysRoot + "/lib/mips64el-linux-gnu")) + return "mips64el-linux-gnu"; break; } case llvm::Triple::ppc: Modified: vendor/clang/dist-release_80/lib/Sema/SemaOpenMP.cpp ============================================================================== --- vendor/clang/dist-release_80/lib/Sema/SemaOpenMP.cpp Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/lib/Sema/SemaOpenMP.cpp Tue Jun 11 18:16:50 2019 (r348934) @@ -4602,8 +4602,7 @@ DeclRefExpr *OpenMPIterationSpaceChecker::buildCounter Captures.insert(std::make_pair(LCRef, Ref)); return Ref; } - return buildDeclRefExpr(SemaRef, VD, VD->getType().getNonReferenceType(), - DefaultLoc); + return cast<DeclRefExpr>(LCRef); } Expr *OpenMPIterationSpaceChecker::buildPrivateCounterVar() const { Modified: vendor/clang/dist-release_80/test/Driver/cl-options.c ============================================================================== --- vendor/clang/dist-release_80/test/Driver/cl-options.c Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/test/Driver/cl-options.c Tue Jun 11 18:16:50 2019 (r348934) @@ -66,7 +66,7 @@ // RUN: %clang_cl -### /FA -fprofile-instr-generate=/tmp/somefile.profraw -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s // RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s // RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use=file -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// CHECK-PROFILE-GENERATE: "-fprofile-instrument=clang" +// CHECK-PROFILE-GENERATE: "-fprofile-instrument=clang" "--dependent-lib={{[^"]*}}clang_rt.profile-{{[^"]*}}.lib" // CHECK-PROFILE-GENERATE-FILE: "-fprofile-instrument-path=/tmp/somefile.profraw" // CHECK-NO-MIX-GEN-USE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}' Modified: vendor/clang/dist-release_80/test/Driver/instrprof-ld.c ============================================================================== --- vendor/clang/dist-release_80/test/Driver/instrprof-ld.c Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/test/Driver/instrprof-ld.c Tue Jun 11 18:16:50 2019 (r348934) @@ -121,3 +121,17 @@ // // CHECK-WINDOWS-X86-64: "{{.*}}link{{(.exe)?}}" // CHECK-WINDOWS-X86-64: "{{.*}}clang_rt.profile-x86_64.lib" + +// Test instrumented profiling dependent-lib flags +// +// RUN: %clang %s -### -o %t.o -target x86_64-pc-win32 \ +// RUN: -fprofile-instr-generate 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-WINDOWS-X86-64-DEPENDENT-LIB %s +// +// CHECK-WINDOWS-X86-64-DEPENDENT-LIB: "--dependent-lib={{[^"]*}}clang_rt.profile-{{[^"]*}}.lib" +// +// RUN: %clang %s -### -o %t.o -target x86_64-mingw32 \ +// RUN: -fprofile-instr-generate 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MINGW-X86-64-DEPENDENT-LIB %s +// +// CHECK-MINGW-X86-64-DEPENDENT-LIB-NOT: "--dependent-lib={{[^"]*}}clang_rt.profile-{{[^"]*}}.a" Modified: vendor/clang/dist-release_80/test/Driver/linux-ld.c ============================================================================== --- vendor/clang/dist-release_80/test/Driver/linux-ld.c Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/test/Driver/linux-ld.c Tue Jun 11 18:16:50 2019 (r348934) @@ -1632,6 +1632,11 @@ // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=mips64-unknown-linux-gnu \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=mips64-linux-gnuabi64 -mabi=n64 \ // RUN: --gcc-toolchain="" \ // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \ @@ -1651,6 +1656,11 @@ // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtend.o" // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crtn.o" // +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=mips64el-unknown-linux-gnu \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=mips64el-linux-gnuabi64 -mabi=n64 \ // RUN: --gcc-toolchain="" \ Modified: vendor/clang/dist-release_80/test/OpenMP/ordered_doacross_codegen.cpp ============================================================================== --- vendor/clang/dist-release_80/test/OpenMP/ordered_doacross_codegen.cpp Tue Jun 11 18:16:38 2019 (r348933) +++ vendor/clang/dist-release_80/test/OpenMP/ordered_doacross_codegen.cpp Tue Jun 11 18:16:50 2019 (r348934) @@ -16,6 +16,17 @@ extern int n; int a[10], b[10], c[10], d[10]; void foo(); +// CHECK-LABEL:bar +void bar() { + int i,j; +// CHECK: call void @__kmpc_doacross_init( +// CHECK: call void @__kmpc_doacross_fini( +#pragma omp parallel for ordered(2) + for (i = 0; i < n; ++i) + for (j = 0; j < n; ++j) + a[i] = b[i] + 1; +} + // CHECK-LABEL: @main() int main() { int i; @@ -35,7 +46,7 @@ int main() { // CHECK: call void @__kmpc_doacross_init([[IDENT]], i32 [[GTID]], i32 1, i8* [[CAST]]) // CHECK: call void @__kmpc_for_static_init_4( #pragma omp for ordered(1) - for (i = 0; i < n; ++i) { + for (int i = 0; i < n; ++i) { a[i] = b[i] + 1; foo(); // CHECK: invoke void [[FOO:.+]](
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906111816.x5BIGojU037373>