summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-10-12 21:35:29 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-10-12 21:35:29 +0000
commitf91b0c1c18cceb249ad21f8b375f8f91c94c4620 (patch)
tree34ad5e3615aae79ac0d4e58e828842485414a876 /contrib/llvm-project/llvm/lib
parentc88da3b94d9bfbce75b6213db6c2982ebfd9de1c (diff)
parent30078f49665261b45a7cebc2f05a5206301e29a6 (diff)
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/lib')
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp4
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp8
2 files changed, 9 insertions, 3 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 64af293caf9e..8b3e6189a07f 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/contrib/llvm-project/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/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp b/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
index bd554189f12b..f9773f74a7bd 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/TailDuplicator.cpp
+++ b/contrib/llvm-project/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())