diff options
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch')
-rw-r--r-- | dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch deleted file mode 100644 index 09be8202..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0008-ispc-10_0_9_0_fix_for_1767.patch +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | From 294ca2fd69a077b35acec9d498120d6cb0324dae Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Fri, 27 Aug 2021 11:53:27 +0800 | ||
4 | Subject: [PATCH 1/2] This patch is required to fix the crash referenced to in | ||
5 | #1767 | ||
6 | |||
7 | It is a port of the following llvm 11.0 commit : https://reviews.llvm.org/D76994. | ||
8 | |||
9 | Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/41f13f1f64d2074ae7512fb23656c22585e912bd] | ||
10 | |||
11 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
12 | --- | ||
13 | .../CodeGen/SelectionDAG/LegalizeTypes.cpp | 3 +- | ||
14 | llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 31 ++++++++++++------- | ||
15 | 2 files changed, 21 insertions(+), 13 deletions(-) | ||
16 | |||
17 | diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | ||
18 | index 63ddb59fce68..822da2183269 100644 | ||
19 | --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | ||
20 | +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | ||
21 | @@ -173,7 +173,7 @@ void DAGTypeLegalizer::PerformExpensiveChecks() { | ||
22 | } | ||
23 | } | ||
24 | } | ||
25 | - | ||
26 | +#ifndef NDEBUG | ||
27 | // Checked that NewNodes are only used by other NewNodes. | ||
28 | for (unsigned i = 0, e = NewNodes.size(); i != e; ++i) { | ||
29 | SDNode *N = NewNodes[i]; | ||
30 | @@ -181,6 +181,7 @@ void DAGTypeLegalizer::PerformExpensiveChecks() { | ||
31 | UI != UE; ++UI) | ||
32 | assert(UI->getNodeId() == NewNode && "NewNode used by non-NewNode!"); | ||
33 | } | ||
34 | +#endif | ||
35 | } | ||
36 | |||
37 | /// This is the main entry point for the type legalizer. This does a top-down | ||
38 | diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | ||
39 | index faae14444d51..b908c5c58e9f 100644 | ||
40 | --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | ||
41 | +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | ||
42 | @@ -155,7 +155,9 @@ private: | ||
43 | const SDValue &getSDValue(TableId &Id) { | ||
44 | RemapId(Id); | ||
45 | assert(Id && "TableId should be non-zero"); | ||
46 | - return IdToValueMap[Id]; | ||
47 | + auto I = IdToValueMap.find(Id); | ||
48 | + assert(I != IdToValueMap.end() && "cannot find Id in map"); | ||
49 | + return I->second; | ||
50 | } | ||
51 | |||
52 | public: | ||
53 | @@ -172,24 +174,29 @@ public: | ||
54 | bool run(); | ||
55 | |||
56 | void NoteDeletion(SDNode *Old, SDNode *New) { | ||
57 | + assert(Old != New && "node replaced with self"); | ||
58 | for (unsigned i = 0, e = Old->getNumValues(); i != e; ++i) { | ||
59 | TableId NewId = getTableId(SDValue(New, i)); | ||
60 | TableId OldId = getTableId(SDValue(Old, i)); | ||
61 | |||
62 | - if (OldId != NewId) | ||
63 | + if (OldId != NewId) { | ||
64 | ReplacedValues[OldId] = NewId; | ||
65 | |||
66 | - // Delete Node from tables. | ||
67 | + // Delete Node from tables. We cannot do this when OldId == NewId, | ||
68 | + // because NewId can still have table references to it in | ||
69 | + // ReplacedValues. | ||
70 | + IdToValueMap.erase(OldId); | ||
71 | + PromotedIntegers.erase(OldId); | ||
72 | + ExpandedIntegers.erase(OldId); | ||
73 | + SoftenedFloats.erase(OldId); | ||
74 | + PromotedFloats.erase(OldId); | ||
75 | + ExpandedFloats.erase(OldId); | ||
76 | + ScalarizedVectors.erase(OldId); | ||
77 | + SplitVectors.erase(OldId); | ||
78 | + WidenedVectors.erase(OldId); | ||
79 | + } | ||
80 | + | ||
81 | ValueToIdMap.erase(SDValue(Old, i)); | ||
82 | - IdToValueMap.erase(OldId); | ||
83 | - PromotedIntegers.erase(OldId); | ||
84 | - ExpandedIntegers.erase(OldId); | ||
85 | - SoftenedFloats.erase(OldId); | ||
86 | - PromotedFloats.erase(OldId); | ||
87 | - ExpandedFloats.erase(OldId); | ||
88 | - ScalarizedVectors.erase(OldId); | ||
89 | - SplitVectors.erase(OldId); | ||
90 | - WidenedVectors.erase(OldId); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | -- | ||
95 | 2.17.1 | ||
96 | |||