Skip to content

Commit c001489

Browse files
committed
fixup! Move std::set into SelectionDAG instead of reusing FoldingSet.
1 parent 267aa0f commit c001489

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <cstdint>
4545
#include <functional>
4646
#include <map>
47+
#include <set>
4748
#include <string>
4849
#include <tuple>
4950
#include <utility>
@@ -247,6 +248,9 @@ class SelectionDAG {
247248
BlockFrequencyInfo *BFI = nullptr;
248249
MachineModuleInfo *MMI = nullptr;
249250

251+
/// Extended EVTs used for single value VTLists.
252+
std::set<EVT, EVT::compareRawBits> EVTs;
253+
250254
/// List of non-single value types.
251255
FoldingSet<SDVTListNode> VTListMap;
252256

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10626,19 +10626,7 @@ SDVTList SelectionDAG::getVTList(EVT VT) {
1062610626
if (!VT.isExtended())
1062710627
return makeVTList(SDNode::getValueTypeList(VT.getSimpleVT()), 1);
1062810628

10629-
FoldingSetNodeID ID;
10630-
ID.AddInteger(1U);
10631-
ID.AddInteger(VT.getRawBits());
10632-
10633-
void *IP = nullptr;
10634-
SDVTListNode *Result = VTListMap.FindNodeOrInsertPos(ID, IP);
10635-
if (!Result) {
10636-
EVT *Array = Allocator.Allocate<EVT>(1);
10637-
Array[0] = VT;
10638-
Result = new (Allocator) SDVTListNode(ID.Intern(Allocator), Array, 1);
10639-
VTListMap.InsertNode(Result, IP);
10640-
}
10641-
return Result->getSDVTList();
10629+
return makeVTList(&(*EVTs.insert(VT).first), 1);
1064210630
}
1064310631

1064410632
SDVTList SelectionDAG::getVTList(EVT VT1, EVT VT2) {

0 commit comments

Comments
 (0)