[llvm-branch-commits] [clang] 0fe369a - Strip preceeding -Xclang when stripping -fcolor-diagnostics or -fdiagnostics-color
Author: Kadir Cetinkaya Date: 2020-02-26T09:28:39+01:00 New Revision: 0fe369ad5ff69394b9076b1a679502c3993488d1 URL: https://github.com/llvm/llvm-project/commit/0fe369ad5ff69394b9076b1a679502c3993488d1 DIFF: https://github.com/llvm/llvm-project/commit/0fe369ad5ff69394b9076b1a679502c3993488d1.diff LOG: Strip preceeding -Xclang when stripping -fcolor-diagnostics or -fdiagnostics-color Summary: Fixes https://github.com/clangd/clangd/issues/279. We were removing the color options but not the preceeding -Xclang which causes errors since the -Xclang would now apply to the next option in the list of options. Now, when removing a color option, we check if there was a preceeding -Xclang and remove it as well. Patch By @DaanDeMeyer ! Reviewers: sammccall, kadircet Reviewed By: sammccall Subscribers: ilya-biryukov, usaxena95 Differential Revision: https://reviews.llvm.org/D75019 (cherry picked from commit da236f235028c82c2f0e00eea1f6f9c689bcae4a) Added: Modified: clang/lib/Tooling/ArgumentsAdjusters.cpp Removed: diff --git a/clang/lib/Tooling/ArgumentsAdjusters.cpp b/clang/lib/Tooling/ArgumentsAdjusters.cpp index a609e4ed2469..ec15311d4bac 100644 --- a/clang/lib/Tooling/ArgumentsAdjusters.cpp +++ b/clang/lib/Tooling/ArgumentsAdjusters.cpp @@ -42,6 +42,12 @@ ArgumentsAdjuster getClangSyntaxOnlyAdjuster() { if (!Arg.startswith("-fcolor-diagnostics") && !Arg.startswith("-fdiagnostics-color")) AdjustedArgs.push_back(Args[i]); + // If we strip a color option, make sure we strip any preceeding `-Xclang` + // option as well. + // FIXME: This should be added to most argument adjusters! + else if (!AdjustedArgs.empty() && AdjustedArgs.back() == "-Xclang") +AdjustedArgs.pop_back(); + if (Arg == "-fsyntax-only") HasSyntaxOnly = true; } ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 8b0df8e - [LoopRotate] Get and update MSSA only if available in legacy pass manager.
Author: Alina Sbirlea Date: 2020-02-26T10:06:30+01:00 New Revision: 8b0df8e1ed6842095388fce08a0a5f761cd905ed URL: https://github.com/llvm/llvm-project/commit/8b0df8e1ed6842095388fce08a0a5f761cd905ed DIFF: https://github.com/llvm/llvm-project/commit/8b0df8e1ed6842095388fce08a0a5f761cd905ed.diff LOG: [LoopRotate] Get and update MSSA only if available in legacy pass manager. Summary: Potential fix for: https://bugs.llvm.org/show_bug.cgi?id=44889 and https://bugs.llvm.org/show_bug.cgi?id=44408 In the legacy pass manager, loop rotate need not compute MemorySSA when not being in the same loop pass manager with other loop passes. There isn't currently a way to differentiate between the two cases, so this attempts to limit the usage in LoopRotate to only update MemorySSA when the analysis is already available. The side-effect of this is that it will split the Loop pipeline. This issue does not apply to the new pass manager, where we have a flag specifying if all loop passes in that loop pass manager preserve MemorySSA. Reviewers: dmgreen, fedor.sergeev, nikic Subscribers: Prazek, hiraditya, george.burgess.iv, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74574 (cherry picked from commit 1326a5a4cfe004181f2ec8231d84ecda2b93cb25) Added: Modified: llvm/lib/Transforms/Scalar/LoopRotation.cpp llvm/test/Other/opt-O2-pipeline.ll llvm/test/Other/opt-O3-pipeline.ll llvm/test/Other/opt-Os-pipeline.ll llvm/test/Other/pass-pipelines.ll Removed: diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp index 0868e742f4ee..67c20b2edae8 100644 --- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -81,10 +81,8 @@ class LoopRotateLegacyPass : public LoopPass { void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired(); AU.addRequired(); -if (EnableMSSALoopDependency) { - AU.addRequired(); +if (EnableMSSALoopDependency) AU.addPreserved(); -} getLoopAnalysisUsage(AU); } @@ -101,8 +99,11 @@ class LoopRotateLegacyPass : public LoopPass { const SimplifyQuery SQ = getBestSimplifyQuery(*this, F); Optional MSSAU; if (EnableMSSALoopDependency) { - MemorySSA *MSSA = &getAnalysis().getMSSA(); - MSSAU = MemorySSAUpdater(MSSA); + // Not requiring MemorySSA and getting it only if available will split + // the loop pass pipeline when LoopRotate is being run first. + auto *MSSAA = getAnalysisIfAvailable(); + if (MSSAA) +MSSAU = MemorySSAUpdater(&MSSAA->getMSSA()); } return LoopRotation(L, LI, TTI, AC, &DT, &SE, MSSAU.hasValue() ? MSSAU.getPointer() : nullptr, SQ, diff --git a/llvm/test/Other/opt-O2-pipeline.ll b/llvm/test/Other/opt-O2-pipeline.ll index 31527e6169b3..da0edf105ee3 100644 --- a/llvm/test/Other/opt-O2-pipeline.ll +++ b/llvm/test/Other/opt-O2-pipeline.ll @@ -100,16 +100,17 @@ ; CHECK-NEXT: Simplify the CFG ; CHECK-NEXT: Reassociate expressions ; CHECK-NEXT: Dominator Tree Construction -; CHECK-NEXT: Basic Alias Analysis (stateless AA impl) -; CHECK-NEXT: Function Alias Analysis Results -; CHECK-NEXT: Memory SSA ; CHECK-NEXT: Natural Loop Information ; CHECK-NEXT: Canonicalize natural loops ; CHECK-NEXT: LCSSA Verifier ; CHECK-NEXT: Loop-Closed SSA Form Pass +; CHECK-NEXT: Basic Alias Analysis (stateless AA impl) +; CHECK-NEXT: Function Alias Analysis Results ; CHECK-NEXT: Scalar Evolution Analysis ; CHECK-NEXT: Loop Pass Manager ; CHECK-NEXT: Rotate Loops +; CHECK-NEXT: Memory SSA +; CHECK-NEXT: Loop Pass Manager ; CHECK-NEXT: Loop Invariant Code Motion ; CHECK-NEXT: Unswitch loops ; CHECK-NEXT: Simplify the CFG @@ -200,13 +201,12 @@ ; CHECK-NEXT: Float to int ; CHECK-NEXT: Lower constant intrinsics ; CHECK-NEXT: Dominator Tree Construction -; CHECK-NEXT: Basic Alias Analysis (stateless AA impl) -; CHECK-NEXT: Function Alias Analysis Results -; CHECK-NEXT: Memory SSA ; CHECK-NEXT: Natural Loop Information ; CHECK-NEXT: Canonicalize natural loops ; CHECK-NEXT: LCSSA Verifier ; CHECK-NEXT: Loop-Closed SSA Form Pass +; CHECK-NEXT: Basic Alias Analysis (stateless AA impl) +; CHECK-NEXT: Function Alias Analysis Results ; CHECK-NEXT: Scalar Evolution Analysis ; CHECK-NEXT: Loop Pass Manager ; CHECK-NEXT: Rotate Loops diff --git a/llvm/test/Other/opt-O3-pipeline.ll b/llvm/test/Other/opt-O3-pipeline.ll index cb19835e05e6..113137a6fd30 100644 --- a/llvm/test/Other/opt-O3-pipeline.ll +++ b/llvm/test/Other/opt-O3-pipeline.ll @@ -105,16 +105,17 @@ ; CHECK-NEXT
[llvm-branch-commits] [clang] 6f4f4f2 - [remark][diagnostics] [codegen] Fix PR44896
Author: Rong Xu Date: 2020-02-26T11:55:29+01:00 New Revision: 6f4f4f2c8ce1ad17bdec9fe2071d3fe439eca9eb URL: https://github.com/llvm/llvm-project/commit/6f4f4f2c8ce1ad17bdec9fe2071d3fe439eca9eb DIFF: https://github.com/llvm/llvm-project/commit/6f4f4f2c8ce1ad17bdec9fe2071d3fe439eca9eb.diff LOG: [remark][diagnostics] [codegen] Fix PR44896 This patch fixes PR44896. For IR input files, option fdiscard-value-names should be ignored as we need named values in loadModule(). Commit 60d3947922 sets this option after loadModule() where valued names already created. This creates an inconsistent state in setNameImpl() that leads to a seg fault. This patch forces fdiscard-value-names to be false for IR input files. This patch also emits a warning of "ignoring -fdiscard-value-names" if option fdiscard-value-names is explictly enabled in the commandline for IR input files. Differential Revision: https://reviews.llvm.org/D74878 (cherry picked from commit 11857d49948b845dcfd7c7f78595095e3add012d) Added: clang/test/CodeGen/PR44896.ll Modified: clang/include/clang/Basic/DiagnosticDriverKinds.td clang/lib/CodeGen/CodeGenAction.cpp clang/lib/Driver/ToolChains/Clang.cpp Removed: diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index ecd871e36ee8..48ece91d3c45 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -271,6 +271,9 @@ def warn_drv_unsupported_debug_info_opt_for_target : Warning< InGroup; def warn_c_kext : Warning< "ignoring -fapple-kext which is valid for C++ and Objective-C++ only">; +def warn_ignoring_fdiscard_for_bitcode : Warning< + "ignoring -fdiscard-value-names for LLVM Bitcode">, + InGroup; def warn_drv_input_file_unused : Warning< "%0: '%1' input unused%select{ when '%3' is present|}2">, InGroup; diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 7065e78f19a2..20ebaf3578d6 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -1146,6 +1146,9 @@ void CodeGenAction::ExecuteAction() { CI.getTargetOpts(), CI.getLangOpts(), CI.getFrontendOpts().ShowTimers, std::move(LinkModules), *VMContext, nullptr); +// PR44896: Force DiscardValueNames as false. DiscardValueNames cannot be +// true here because the valued names are needed for reading textual IR. +Ctx.setDiscardValueNames(false); Ctx.setDiagnosticHandler( std::make_unique(CodeGenOpts, &Result)); diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index aec1971214cf..fa025be14e43 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4266,8 +4266,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Discard value names in assert builds unless otherwise specified. if (Args.hasFlag(options::OPT_fdiscard_value_names, - options::OPT_fno_discard_value_names, !IsAssertBuild)) + options::OPT_fno_discard_value_names, !IsAssertBuild)) { +if (Args.hasArg(options::OPT_fdiscard_value_names) && +(std::any_of(Inputs.begin(), Inputs.end(), + [](const clang::driver::InputInfo &II) { + return types::isLLVMIR(II.getType()); + }))) { + D.Diag(diag::warn_ignoring_fdiscard_for_bitcode); +} CmdArgs.push_back("-discard-value-names"); + } // Set the main file name, so that debug info works even with // -save-temps. diff --git a/clang/test/CodeGen/PR44896.ll b/clang/test/CodeGen/PR44896.ll new file mode 100644 index ..a4d344579870 --- /dev/null +++ b/clang/test/CodeGen/PR44896.ll @@ -0,0 +1,15 @@ +; RUN: %clang -fdiscard-value-names -S %s -o /dev/null 2>&1 | FileCheck --check-prefix=WARNING %s +; RUN: %clang -S %s -o /dev/null 2>&1 | FileCheck --check-prefix=NOWARNING %s +; RUN: %clang_cc1 -S -emit-llvm %s -discard-value-names -o /dev/null +; PR 44896 + +; WARNING: ignoring -fdiscard-value-names for LLVM Bitcode +; NOWARNING-NOT: ignoring -fdiscard-value-names for LLVM Bitcode + +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64--linux-gnu" + +define linkonce i8* @b(i8* %a) { + ret i8* %a +} + ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 57a064f - Revert "[compiler-rt] Add a critical section when flushing gcov counters"
Author: Hans Wennborg Date: 2020-02-26T13:34:20+01:00 New Revision: 57a064f8dc8301ce8b017c84782286816dc58911 URL: https://github.com/llvm/llvm-project/commit/57a064f8dc8301ce8b017c84782286816dc58911 DIFF: https://github.com/llvm/llvm-project/commit/57a064f8dc8301ce8b017c84782286816dc58911.diff LOG: Revert "[compiler-rt] Add a critical section when flushing gcov counters" See the discussion on PR44792. This reverts commit 02ce9d8ef5a84bc884de4105eae5f8736ef67634. Added: Modified: compiler-rt/lib/profile/GCDAProfiling.c Removed: diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c index 81f2cdd26450..498c05900bf2 100644 --- a/compiler-rt/lib/profile/GCDAProfiling.c +++ b/compiler-rt/lib/profile/GCDAProfiling.c @@ -62,27 +62,8 @@ typedef unsigned long long uint64_t; #include "InstrProfiling.h" #include "InstrProfilingUtil.h" -#ifndef _WIN32 -#include -static pthread_mutex_t gcov_flush_mutex = PTHREAD_MUTEX_INITIALIZER; -static __inline void gcov_flush_lock() { - pthread_mutex_lock(&gcov_flush_mutex); -} -static __inline void gcov_flush_unlock() { - pthread_mutex_unlock(&gcov_flush_mutex); -} -#else -#include -static SRWLOCK gcov_flush_mutex = SRWLOCK_INIT; -static __inline void gcov_flush_lock() { - AcquireSRWLockExclusive(&gcov_flush_mutex); -} -static __inline void gcov_flush_unlock() { - ReleaseSRWLockExclusive(&gcov_flush_mutex); -} -#endif - /* #define DEBUG_GCDAPROFILING */ + /* * --- GCOV file format I/O primitives --- */ @@ -639,16 +620,12 @@ void llvm_register_flush_function(fn_ptr fn) { } void __gcov_flush() { - gcov_flush_lock(); - struct fn_node* curr = flush_fn_list.head; while (curr) { curr->fn(); curr = curr->next; } - - gcov_flush_unlock(); } COMPILER_RT_VISIBILITY ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 3abd9cd - [Codegen] Revert rL354676/rL354677 and followups - introduced PR43446 miscompile
Author: Roman Lebedev Date: 2020-02-26T15:22:28+01:00 New Revision: 3abd9cd486d9c45867458f64d1294db698c39b4e URL: https://github.com/llvm/llvm-project/commit/3abd9cd486d9c45867458f64d1294db698c39b4e DIFF: https://github.com/llvm/llvm-project/commit/3abd9cd486d9c45867458f64d1294db698c39b4e.diff LOG: [Codegen] Revert rL354676/rL354677 and followups - introduced PR43446 miscompile This reverts https://reviews.llvm.org/D58468 (rL354676, 44037d7a6377ec8e5542cced73583283334b516b), and all and any follow-ups to that code block. https://bugs.llvm.org/show_bug.cgi?id=43446 (cherry picked from commit d20907d1de89bf63b589fadd8c096d4895e47fba) Added: Modified: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll llvm/test/CodeGen/PowerPC/constant-combines.ll llvm/test/CodeGen/X86/constant-combines.ll llvm/test/CodeGen/X86/lifetime-alias.ll llvm/test/CodeGen/X86/pr40631_deadstore_elision.ll llvm/test/CodeGen/X86/stores-merging.ll Removed: diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index e5bc08b9280a..8ff04797c8d8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -16510,33 +16510,6 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) { CombineTo(ST1, ST1->getChain()); return SDValue(); } - -// If ST stores to a subset of preceding store's write set, we may be -// able to fold ST's value into the preceding stored value. As we know -// the other uses of ST1's chain are unconcerned with ST, this folding -// will not affect those nodes. -int64_t BitOffset; -if (ChainBase.contains(DAG, ChainBitSize, STBase, STBitSize, - BitOffset)) { - SDValue ChainValue = ST1->getValue(); - if (auto *C1 = dyn_cast(ChainValue)) { -if (auto *C = dyn_cast(Value)) { - APInt Val = C1->getAPIntValue(); - APInt InsertVal = C->getAPIntValue().zextOrTrunc(STBitSize); - // FIXME: Handle Big-endian mode. - if (!DAG.getDataLayout().isBigEndian()) { -Val.insertBits(InsertVal, BitOffset); -SDValue NewSDVal = -DAG.getConstant(Val, SDLoc(C), ChainValue.getValueType(), -C1->isTargetOpcode(), C1->isOpaque()); -SDNode *NewST1 = DAG.UpdateNodeOperands( -ST1, ST1->getChain(), NewSDVal, ST1->getOperand(2), -ST1->getOperand(3)); -return CombineTo(ST, SDValue(NewST1, 0)); - } -} - } -} // End ST subset of ST1 case. } } } diff --git a/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll b/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll index f36131223b04..697ba4615dc4 100644 --- a/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll +++ b/llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -mcpu cortex-a53 < %s | FileCheck %s target datalayout = "e-m:e-i64:64-i128:128-n8:16:32:64-S128" target triple = "aarch64--linux-gnu" @@ -10,11 +11,33 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) #3 define i32 @main() local_unnamed_addr #1 { ; Make sure the stores happen in the correct order (the exact instructions could change). ; CHECK-LABEL: main: +; CHECK: // %bb.0: // %for.body.lr.ph.i.i.i.i.i.i63 +; CHECK-NEXT:sub sp, sp, #112 // =112 +; CHECK-NEXT:str x30, [sp, #96] // 8-byte Folded Spill +; CHECK-NEXT:.cfi_def_cfa_offset 112 +; CHECK-NEXT:.cfi_offset w30, -16 +; CHECK-NEXT:bl _Z5setupv +; CHECK-NEXT:movi v0.4s, #1 +; CHECK-NEXT:mov w9, #1 +; CHECK-NEXT:add x0, sp, #48 // =48 +; CHECK-NEXT:mov x1, sp +; CHECK-NEXT:str xzr, [sp, #80] +; CHECK-NEXT:str w9, [sp, #80] +; CHECK-NEXT:stp q0, q0, [sp, #48] +; CHECK-NEXT:ldr w8, [sp, #48] +; CHECK-NEXT:cmp w8, #1 // =1 +; CHECK-NEXT:b.ne .LBB0_2 +; CHECK-NEXT: // %bb.1: // %for.inc +; CHECK-NEXT:bl f +; CHECK-NEXT:b .LBB0_3 +; CHECK-NEXT: .LBB0_2: // %if.then +; CHECK-NEXT:bl f2 +; CHECK-NEXT: .LBB0_3: // %for.inc +; CHECK-NEXT:ldr x30, [sp, #96] // 8-byte Folded Reload +; CHECK-NEXT:mov w0, wzr +; CHECK-NEXT:add sp, sp, #112 // =112 +; CHECK-NEXT:ret -; CHECK: mov w9, #1 -; CHECK: str x9, [sp, #80] -; CHECK: stp q0, q0, [sp, #48] -; CHECK: ldr w8, [sp, #48] for.body.lr.ph.i.i.i.i.i.i63: %b1 = alloca [10 x i32], align 16 diff --git a/llvm/test/CodeGen/PowerPC/constant-combines.ll b/llvm/test/CodeGen/PowerPC/constant-combines.ll index dd40b75d58f0..05f23051d407 100644 --- a/llvm/test/CodeGen/PowerPC
[llvm-branch-commits] [clang] f87cc45 - Put microsoft template parameter shadow warning behind separate flag (PR44794)
Author: Hans Wennborg Date: 2020-02-26T16:06:11+01:00 New Revision: f87cc45dffa0a83b9db1aff143829d3f5c04c52f URL: https://github.com/llvm/llvm-project/commit/f87cc45dffa0a83b9db1aff143829d3f5c04c52f DIFF: https://github.com/llvm/llvm-project/commit/f87cc45dffa0a83b9db1aff143829d3f5c04c52f.diff LOG: Put microsoft template parameter shadow warning behind separate flag (PR44794) Differential revision: https://reviews.llvm.org/D75121 (cherry picked from commit 41a6612ea8afc5254e4de3aca55628d37f0be433) Added: clang/test/SemaCXX/microsoft-template-shadow.cpp Modified: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Basic/DiagnosticSemaKinds.td Removed: diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 67885ac14ab5..8e43052f30e2 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1014,7 +1014,8 @@ def MicrosoftExplicitConstructorCall : DiagGroup< def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">; def MicrosoftDefaultArgRedefinition : DiagGroup<"microsoft-default-arg-redefinition">; -def MicrosoftTemplate : DiagGroup<"microsoft-template">; +def MicrosoftTemplateShadow : DiagGroup<"microsoft-template-shadow">; +def MicrosoftTemplate : DiagGroup<"microsoft-template", [MicrosoftTemplateShadow]>; def MicrosoftInconsistentDllImport : DiagGroup<"inconsistent-dllimport">; def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">; def MicrosoftEnumForwardReference : diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index f643739eaac1..917377420505 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -4210,7 +4210,7 @@ def err_ovl_no_viable_literal_operator : Error< def err_template_param_shadow : Error< "declaration of %0 shadows template parameter">; def ext_template_param_shadow : ExtWarn< - err_template_param_shadow.Text>, InGroup; + err_template_param_shadow.Text>, InGroup; def note_template_param_here : Note<"template parameter is declared here">; def warn_template_export_unsupported : Warning< "exported templates are unsupported">; diff --git a/clang/test/SemaCXX/microsoft-template-shadow.cpp b/clang/test/SemaCXX/microsoft-template-shadow.cpp new file mode 100644 index ..ab2ffdefdd8f --- /dev/null +++ b/clang/test/SemaCXX/microsoft-template-shadow.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -verify -fms-compatibility -Wno-microsoft -Wmicrosoft-template-shadow + +template // expected-note {{template parameter is declared here}} +struct Outmost { + template // expected-warning {{declaration of 'T' shadows template parameter}} + struct Inner { +void f() { + T *var; +} + }; +}; ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 48d2446 - Revert "[LICM] Support hosting of dynamic allocas out of loops"
Author: Philip Reames Date: 2020-02-26T16:13:01+01:00 New Revision: 48d24465668b268ec0aa39b62cabab5ee50e961d URL: https://github.com/llvm/llvm-project/commit/48d24465668b268ec0aa39b62cabab5ee50e961d DIFF: https://github.com/llvm/llvm-project/commit/48d24465668b268ec0aa39b62cabab5ee50e961d.diff LOG: Revert "[LICM] Support hosting of dynamic allocas out of loops" This reverts commit 8d22100f66c4170510c6ff028c60672acfe1cff9. There was a functional regression reported (https://bugs.llvm.org/show_bug.cgi?id=44996). I'm not actually sure the patch is wrong, but I don't have time to investigate currently, and this line of work isn't something I'm likely to get back to quickly. (cherry picked from commit 14845b2c459021e3dbf2ead52d707d4a7db40cbb) Added: Modified: llvm/lib/Transforms/Scalar/LICM.cpp Removed: llvm/test/Transforms/LICM/hoist-alloca.ll diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index eb023d49b0a3..a1c012fddde3 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -790,41 +790,6 @@ class ControlFlowHoister { }; } // namespace - -/// Return true if we know how to rewrite all uses of the given alloca after -/// hoisting it out of the loop. The main concerns are a) potential captures -/// and b) invariant.start markers which don't capture, but are no longer -/// valid w/o a corresponding invariant.end. -static bool canRewriteUsesOfAlloca(AllocaInst &AI) { - // TODO: This looks a lot like capture tracking, but we need to remove any - // invariant starts if we extend the lifetime of the alloca by hoisting it. - // We should probably refactor capture tracking into a form which allows us - // to reuse the relevant bits and remove the duplicated logic here. - - SmallVector Worklist; - for (Use &U : AI.uses()) -Worklist.push_back(&U); - - unsigned NumUsesExplored = 0; - while (!Worklist.empty()) { -Use *U = Worklist.pop_back_val(); -Instruction *I = cast(U->getUser()); -NumUsesExplored++; -if (NumUsesExplored > DefaultMaxUsesToExplore) - return false; -// Non capturing, terminating uses -if (isa(I) || -(isa(I) && U->getOperandNo() == 1)) - continue; -// Non capturing, non-terminating -if (!isa(I) && !isa(I)) - return false; -for (Use &U : I->uses()) - Worklist.push_back(&U); - } - return true; -} - /// Walk the specified region of the CFG (defined by all blocks dominated by /// the specified block, and that are in the current loop) in depth first /// order w.r.t the DominatorTree. This allows us to visit definitions before @@ -945,16 +910,6 @@ bool llvm::hoistRegion(DomTreeNode *N, AliasAnalysis *AA, LoopInfo *LI, continue; } - if (isa(&I) && - SafetyInfo->isGuaranteedToExecute(I, DT, CurLoop) && - canRewriteUsesOfAlloca(cast(I))) { -hoist(I, DT, CurLoop, CFH.getOrCreateHoistedBlock(BB), SafetyInfo, - MSSAU, SE, ORE); -HoistedInstructions.push_back(&I); -Changed = true; -continue; - } - if (PHINode *PN = dyn_cast(&I)) { if (CFH.canHoistPHI(PN)) { // Redirect incoming blocks first to ensure that we create hoisted diff --git a/llvm/test/Transforms/LICM/hoist-alloca.ll b/llvm/test/Transforms/LICM/hoist-alloca.ll deleted file mode 100644 index 8e4debac2838.. --- a/llvm/test/Transforms/LICM/hoist-alloca.ll +++ /dev/null @@ -1,168 +0,0 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py -; RUN: opt -S -licm < %s | FileCheck %s - -@G = external global i64 - -define void @test(i64 %n) { -; CHECK-LABEL: @test( -; CHECK-NEXT: entry: -; CHECK-NEXT:[[A:%.*]] = alloca i64 -; CHECK-NEXT:[[VAL:%.*]] = load i64, i64* [[A]] -; CHECK-NEXT:store i64 [[VAL]], i64* @G -; CHECK-NEXT:br label [[FOR_BODY:%.*]] -; CHECK: for.body: -; CHECK-NEXT:[[IV:%.*]] = phi i64 [ [[IV_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ] -; CHECK-NEXT:[[IV_NEXT]] = add nuw nsw i64 [[IV]], 1 -; CHECK-NEXT:[[EXITCOND:%.*]] = icmp ult i64 [[IV]], [[N:%.*]] -; CHECK-NEXT:br i1 [[EXITCOND]], label [[FOR_BODY]], label [[EXIT:%.*]] -; CHECK: exit: -; CHECK-NEXT:ret void -; -entry: - br label %for.body - -for.body: - %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ] - %a = alloca i64 - %val = load i64, i64* %a - store i64 %val, i64* @G - %iv.next = add nuw nsw i64 %iv, 1 - %exitcond = icmp ult i64 %iv, %n - br i1 %exitcond, label %for.body, label %exit -exit: - ret void -} - -define void @test2(i64 %n) { -; CHECK-LABEL: @test2( -; CHECK-NEXT: entry: -; CHECK-NEXT:[[A:%.*]] = alloca i64 -; CHECK-NEXT:br label [[FOR_BODY:%.*]] -; CHECK: for.body: -; CHECK-NEXT:[[IV:%.*]] = phi i64 [ [[IV_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ] -; CHEC
[llvm-branch-commits] [llvm] 456e9c2 - [ReleaseNotes] Mention new matrix intrinsics.
Author: Florian Hahn Date: 2020-02-26T16:56:04Z New Revision: 456e9c2e14bc936100f1d84e7637122b306d8c4c URL: https://github.com/llvm/llvm-project/commit/456e9c2e14bc936100f1d84e7637122b306d8c4c DIFF: https://github.com/llvm/llvm-project/commit/456e9c2e14bc936100f1d84e7637122b306d8c4c.diff LOG: [ReleaseNotes] Mention new matrix intrinsics. Reviewers: anemet, Gerolf Reviewed By: anemet Differential Revision: https://reviews.llvm.org/D75161 Added: Modified: llvm/docs/LangRef.rst llvm/docs/ReleaseNotes.rst Removed: diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 0ae374de4b65..190c282eacc9 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -14553,6 +14553,9 @@ Arguments: "" The argument to this intrinsic must be a vector of floating-point values. + +.. _i_matrixintrinsics: + Matrix Intrinsics - diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst index 60dd07ddb26f..6ade99ab174f 100644 --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -106,6 +106,12 @@ Non-comprehensive list of changes in this release still under heavy development and disabled by default, to enable an early run pass ``-mllvm -attributor-disable=false`` to an invocation of clang. +* New matrix math intrinsics have been added to LLVM + (see :ref:`LLVM Language Reference Manual `), together + with the LowerMatrixIntrinsics pass. The pass lowers matrix intrinsics + to a set of efficient vector instructions. The lowering pass is off + by default and can be enabled by passing ``-mllvm -enable-matrix`` to an + invocation of clang. Changes to the LLVM IR ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 5cfd30a - [RISCV] Add Clang and LLVM Release Notes
Author: Sam Elliott Date: 2020-02-26T18:19:07Z New Revision: 5cfd30add460640264c7d88c4d837a2d4e0ae7b1 URL: https://github.com/llvm/llvm-project/commit/5cfd30add460640264c7d88c4d837a2d4e0ae7b1 DIFF: https://github.com/llvm/llvm-project/commit/5cfd30add460640264c7d88c4d837a2d4e0ae7b1.diff LOG: [RISCV] Add Clang and LLVM Release Notes Added: Modified: clang/docs/ReleaseNotes.rst llvm/docs/ReleaseNotes.rst Removed: diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index b160588b22c5..c9d0461b65aa 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -122,6 +122,9 @@ Non-comprehensive list of changes in this release * For the WebAssembly target, the ``wasm-opt`` tool will now be run if it is found in the PATH, which can reduce code size. +* For the RISC-V target, floating point registers can now be used in inline + assembly constraints. + New Compiler Flags -- @@ -141,6 +144,13 @@ New Compiler Flags please let us know if you encounter a situation where you need to specify this flag for correct program behavior. +- The `-ffixed-xX` flags now work on RISC-V. These reserve the corresponding + general-purpose registers. + +- RISC-V has added `-mcmodel=medany` and `-mcmodel=medlow` as aliases for + `-mcmodel=small` and `-mcmodel=medium` respectively. Preprocessor definitions + for `__riscv_cmodel_medlow` and `__riscv_cmodel_medany` have been corrected. + Deprecated Compiler Flags - @@ -182,6 +192,12 @@ Modified Compiler Flags which is one level below ``-debug-info-kind=limited``. This option causes debug info for classes to be emitted only when a constructor is emitted. +- RISC-V now chooses a slightly diff erent sysroot path and defaults to using + compiler-rt if no GCC installation is detected. + +- RISC-V now supports multilibs in baremetal environments. This support does not + extend to supporting multilib aliases. + New Pragmas in Clang @@ -309,6 +325,11 @@ ABI Changes in Clang `-mabi=` when compiling for RISC-V, due to how extensible this architecture is. +- RISC-V now uses `target-abi` module metadata to encode the chosen psABI. This + ensures that the correct lowering will be done by LLVM when LTO is enabled. + +- An issue with lowering return types in the RISC-V ILP32D psABI has been fixed. + OpenMP Support in Clang --- diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst index 6ade99ab174f..69a055aeef63 100644 --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -252,6 +252,65 @@ Changes to the Windows Target * Fixed section relative relocations in .debug_frame in DWARF debug info +Changes to the RISC-V Target + + +New Features: +* The Machine Outliner has been enabled. +* Shrink-wrapping has been enabled. +* The Machine Scheduler has been enabled and scheduler descriptions for the + Rocket micro-architecture have been added, covering both 32- and 64-bit Rocket + cores. +* This release lays the groundwork for enabling LTO in a future LLVM release. + In particular, LLVM now uses a new `target-abi` module metadata item to + represent the chosen RISC-V psABI variant. Frontends should add this module + flag to prevent ABI lowering problems when LTO is enabled in a future LLVM + release. +* Support has been added for assembling RVC HINT instructions. +* Added code lowering for half-precision floats. +* The `fscsr` and `frcsr` (`fssr`, `frsr`) obsolete aliases have been added to + the assembler for use in legacy code. +* The stack can now be realigned even when there are variable-sized objects in + the same frame. +* fastcc is now supported. +* llvm-objdump now supports `-M no-aliases` and `-M numeric` for altering the + dumped assembly. These match the behaviour of GNU objdump. + +Improvements: +* Trap and Debugtrap now lower to RISC-V-specific trap instructions. +* LLVM IR Inline assembly now supports using ABI register names and using + floating point registers in constraints. +* Stack Pointer adjustments have been changed to better match RISC-V's immediates. +* `ra` (`x1`) can now be used as a callee-saved register. +* The assembler now suggests spelling corrections for unknown assembly + mnemonics. +* Stack offsets of greater than 32-bits are now accepted on RV64. +* Some variadic functions can now be tail-call optimised. +* We now custom-lower 32-bit arithmetic operations on RV64 to reduce + sign-extensions. + + +Bug Fixes: + +* There was an issue with register preservation after calls in interrupt + handlers, where some registers were marked as preserved even though they were + not being preserved by the call. This has been corrected, and now only + callee-saved registers are live over a function call in an interrupt handler + (jus
[llvm-branch-commits] [polly] 00f4618 - Revert "[Polly][docs] Polly release notes."
Author: Hans Wennborg Date: 2020-02-26T19:40:47+01:00 New Revision: 00f4618182ada5316650eebedac3702b73819ec0 URL: https://github.com/llvm/llvm-project/commit/00f4618182ada5316650eebedac3702b73819ec0 DIFF: https://github.com/llvm/llvm-project/commit/00f4618182ada5316650eebedac3702b73819ec0.diff LOG: Revert "[Polly][docs] Polly release notes." It no longer applies after d7afdb596e865c11b853d8c5df7d96d594170e1c. This reverts commit 002af0119286297dbd76b08a4a6cc4b6b87d3f26. Added: Modified: polly/docs/ReleaseNotes.rst Removed: diff --git a/polly/docs/ReleaseNotes.rst b/polly/docs/ReleaseNotes.rst index 5f49e619976d..1d9aacc9aa68 100644 --- a/polly/docs/ReleaseNotes.rst +++ b/polly/docs/ReleaseNotes.rst @@ -10,44 +10,4 @@ In Polly 10 the following important changes have been incorporated. the new features that have recently been committed to our development branch. -Statically Linking of Polly -=== - -The mechanism that Polly uses to link itself statically into the opt, bugpoint and clang executables has been generalized such that it can be used by other pass plugins. An example plugin "Bye" has been added to illustate the mechanism. A consequence of this change is that Polly, like the "Bye" plugin, by default is not linked statically into aforementioned executables anymore. - -If Polly is not available, the executable will report an unkown argument `-polly`, such as - -.. code-block:: console - -$ clang -mllvm -polly -x c - -clang (LLVM option parsing): Unknown command line argument '-polly'. Try: 'clang (LLVM option parsing) --help' -clang (LLVM option parsing): Did you mean '--color'? - -.. code-block:: console - -$ opt -polly -opt: for the -o option: may not occur within a group! -opt: Unknown command line argument '-polly'. Try: 'opt --help' -opt: Did you mean '-o'? - -Polly can be made available using the following methods. - -- Configure LLVM/Clang with the CMake options LLVM_POLLY_LINK_INTO_TOOLS=ON and LLVM_ENABLE_PROJECTS=polly. - - .. code-block:: console - -$ cmake -DLLVM_POLLY_LINK_INTO_TOOLS=ON -DLLVM_ENABLE_PROJECTS=clang;polly ... - - In future versions, LLVM_POLLY_LINK_INTO_TOOLS=ON will be default again if Polly has been enabled. - -- Use the `-load` option to load the Polly module. - - .. code-block:: console - -$ clang -Xclang -load -Xclang path/to/LLVMPolly.so ... - - .. code-block:: console - -$ opt -load path/to/LLVMPolly.so ... - - The LLVMPolly.so module can be found in the `lib/` directory of the build or install-prefix directory. +- Change ... ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] d7afdb5 - [CMake] Default to static linking for subprojects.
Author: Michael Kruse Date: 2020-02-26T19:40:12+01:00 New Revision: d7afdb596e865c11b853d8c5df7d96d594170e1c URL: https://github.com/llvm/llvm-project/commit/d7afdb596e865c11b853d8c5df7d96d594170e1c DIFF: https://github.com/llvm/llvm-project/commit/d7afdb596e865c11b853d8c5df7d96d594170e1c.diff LOG: [CMake] Default to static linking for subprojects. Pass plugins introduced in D61446 do not support dynamic linking on Windows, hence the option LLVM_${name_upper}_LINK_INTO_TOOLS can only work being set to "ON". Currently, it defaults to "OFF" such that such plugins are inoperable by default on Windows. Change the default for subprojects to follow LLVM_ENABLE_PROJECTS. Reviewed By: serge-sans-paille, MaskRay Differential Revision: https://reviews.llvm.org/D72372 (cherry picked from commit 6369b9bf31188bdd472299252deb6db3f650864b) This is for PR45001. Added: Modified: llvm/cmake/modules/AddLLVM.cmake polly/lib/CMakeLists.txt Removed: diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 32798b1b44a0..8d674f93542c 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -854,14 +854,25 @@ endmacro(add_llvm_executable name) # # If NO_MODULE is specified, when option LLVM_${name_upper}_LINK_INTO_TOOLS is set to OFF, # only an object library is built, and no module is built. This is specific to the Polly use case. +# +# The SUBPROJECT argument contains the LLVM project the plugin belongs +# to. If set, the plugin will link statically by default it if the +# project was enabled. function(add_llvm_pass_plugin name) cmake_parse_arguments(ARG -"NO_MODULE" "" "" +"NO_MODULE" "SUBPROJECT" "" ${ARGN}) string(TOUPPER ${name} name_upper) - option(LLVM_${name_upper}_LINK_INTO_TOOLS "Statically link ${name} into tools (if available)" OFF) + # Enable the plugin by default if it was explicitly enabled by the user. + # Note: If was set to "all", LLVM's CMakeLists.txt replaces it with a + # list of all projects, counting as explicitly enabled. + set(link_into_tools_default OFF) + if (ARG_SUBPROJECT AND LLVM_TOOL_${name_upper}_BUILD) +set(link_into_tools_default ON) + endif() + option(LLVM_${name_upper}_LINK_INTO_TOOLS "Statically link ${name} into tools (if available)" ${link_into_tools_default}) if(LLVM_${name_upper}_LINK_INTO_TOOLS) list(REMOVE_ITEM ARG_UNPARSED_ARGUMENTS BUILDTREE_ONLY) diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt index ee0834cc8e32..35614973a5dd 100644 --- a/polly/lib/CMakeLists.txt +++ b/polly/lib/CMakeLists.txt @@ -25,6 +25,7 @@ endif () # the sources them to be recompiled for each of them. add_llvm_pass_plugin(Polly NO_MODULE + SUBPROJECT Polly Analysis/DependenceInfo.cpp Analysis/PolyhedralInfo.cpp Analysis/ScopDetection.cpp ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits