summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-10-12 21:31:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-10-12 21:31:12 +0000
commit30078f49665261b45a7cebc2f05a5206301e29a6 (patch)
treec144d80de428947ddcadee92c244c6ffccbcedd5
parentd189cf5a4676d763c4e28d7a597c55761e356832 (diff)
downloadsrc-test2-vendor/llvm-project/llvmorg-11.0.0-0-g176249bd673.tar.gz
src-test2-vendor/llvm-project/llvmorg-11.0.0-0-g176249bd673.zip
llvmorg-11.0.0-0-g176249bd673 (aka 11.0.0 release).
-rw-r--r--clang/include/clang/Driver/Options.td4
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp6
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp4
-rw-r--r--llvm/lib/CodeGen/TailDuplicator.cpp8
4 files changed, 16 insertions, 6 deletions
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index f818acb39d51..966cb907b7e2 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1435,11 +1435,11 @@ def fno_pch_validate_input_files_content:
Group<f_Group>, Flags<[DriverOption]>;
def fpch_instantiate_templates:
Flag <["-"], "fpch-instantiate-templates">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Flags<[CC1Option, CoreOption]>,
HelpText<"Instantiate templates already while building a PCH">;
def fno_pch_instantiate_templates:
Flag <["-"], "fno-pch-instantiate-templates">,
- Group<f_Group>, Flags<[CC1Option]>;
+ Group<f_Group>, Flags<[CC1Option, CoreOption]>;
defm pch_codegen: OptInFFlag<"pch-codegen", "Generate ", "Do not generate ",
"code for uses of this PCH that assumes an explicit object file will be built for the PCH">;
defm pch_debuginfo: OptInFFlag<"pch-debuginfo", "Generate ", "Do not generate ",
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index f0a5451322aa..af4bcf951e6c 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1197,7 +1197,11 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
if (YcArg && JA.getKind() >= Action::PrecompileJobClass &&
JA.getKind() <= Action::AssembleJobClass) {
CmdArgs.push_back(Args.MakeArgString("-building-pch-with-obj"));
- CmdArgs.push_back(Args.MakeArgString("-fpch-instantiate-templates"));
+ // -fpch-instantiate-templates is the default when creating
+ // precomp using /Yc
+ if (Args.hasFlag(options::OPT_fpch_instantiate_templates,
+ options::OPT_fno_pch_instantiate_templates, true))
+ CmdArgs.push_back(Args.MakeArgString("-fpch-instantiate-templates"));
}
if (YcArg || YuArg) {
StringRef ThroughHeader = YcArg ? YcArg->getValue() : YuArg->getValue();
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 64af293caf9e..8b3e6189a07f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -5751,10 +5751,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue Op, SelectionDAG &DAG,
// If we already have the use of the negated floating constant, it is free
// to negate it even it has multiple uses.
- if (!Op.hasOneUse() && CFP.use_empty()) {
- RemoveDeadNode(CFP);
+ if (!Op.hasOneUse() && CFP.use_empty())
break;
- }
Cost = NegatibleCost::Neutral;
return CFP;
}
diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp
index bd554189f12b..f9773f74a7bd 100644
--- a/llvm/lib/CodeGen/TailDuplicator.cpp
+++ b/llvm/lib/CodeGen/TailDuplicator.cpp
@@ -627,6 +627,14 @@ bool TailDuplicator::shouldTailDuplicate(bool IsSimple,
if (PreRegAlloc && MI.isCall())
return false;
+ // TailDuplicator::appendCopies will erroneously place COPYs after
+ // INLINEASM_BR instructions after 4b0aa5724fea, which demonstrates the same
+ // bug that was fixed in f7a53d82c090.
+ // FIXME: Use findPHICopyInsertPoint() to find the correct insertion point
+ // for the COPY when replacing PHIs.
+ if (MI.getOpcode() == TargetOpcode::INLINEASM_BR)
+ return false;
+
if (MI.isBundle())
InstrCount += MI.getBundleSize();
else if (!MI.isPHI() && !MI.isMetaInstruction())