Skip to content

Commit 3d83912

Browse files
committed
Revert rGfae7b98c221b5b28797f7b56b656b6b819d99f27 "[Support] Change SetVector's default template parameter to SmallVector<*, 0>"
This is failing on Windows MSVC builds: llvm\unittests\Support\ThreadPool.cpp(380): error C2440: 'return': cannot convert from 'Vector' to 'std::vector<llvm::BitVector,std::allocator<llvm::BitVector>>' with [ Vector=llvm::SmallVector<llvm::BitVector,0> ]
1 parent 9e44ba6 commit 3d83912

File tree

7 files changed

+25
-37
lines changed

7 files changed

+25
-37
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,7 @@ static bool requiresMemberFunctionPointerTypeMetadata(CodeGenModule &CGM,
22362236
!isa<CXXDestructorDecl>(MD);
22372237
}
22382238

2239-
SmallVector<const CXXRecordDecl *, 0>
2239+
std::vector<const CXXRecordDecl *>
22402240
CodeGenModule::getMostBaseClasses(const CXXRecordDecl *RD) {
22412241
llvm::SetVector<const CXXRecordDecl *> MostBases;
22422242

clang/lib/CodeGen/CodeGenModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ class CodeGenModule : public CodeGenTypeCache {
15051505
///
15061506
/// A most-base class of a class C is defined as a recursive base class of C,
15071507
/// including C itself, that does not have any bases.
1508-
SmallVector<const CXXRecordDecl *, 0>
1508+
std::vector<const CXXRecordDecl *>
15091509
getMostBaseClasses(const CXXRecordDecl *RD);
15101510

15111511
/// Get the declaration of std::terminate for the platform.

llvm/include/llvm/ADT/SetVector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#include "llvm/ADT/ArrayRef.h"
2424
#include "llvm/ADT/DenseSet.h"
2525
#include "llvm/ADT/STLExtras.h"
26-
#include "llvm/ADT/SmallVector.h"
2726
#include "llvm/Support/Compiler.h"
2827
#include <cassert>
2928
#include <iterator>
29+
#include <vector>
3030

3131
namespace llvm {
3232

@@ -52,7 +52,7 @@ namespace llvm {
5252
/// when searching for elements instead of checking Set, due to it being better
5353
/// for performance. A value of 0 means that this mode of operation is not used,
5454
/// and is the default value.
55-
template <typename T, typename Vector = SmallVector<T, 0>,
55+
template <typename T, typename Vector = std::vector<T>,
5656
typename Set = DenseSet<T>, unsigned N = 0>
5757
class SetVector {
5858
// Much like in SmallPtrSet, this value should not be too high to prevent

llvm/lib/Analysis/ModuleSummaryAnalysis.cpp

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extern cl::opt<bool> ScalePartialSampleProfileWorkingSetSize;
9393
// instruction in it takes an address of any basic block, because instruction
9494
// can only take an address of basic block located in the same function.
9595
static bool findRefEdges(ModuleSummaryIndex &Index, const User *CurUser,
96-
SetVector<ValueInfo, std::vector<ValueInfo>> &RefEdges,
96+
SetVector<ValueInfo> &RefEdges,
9797
SmallPtrSet<const User *, 8> &Visited) {
9898
bool HasBlockAddress = false;
9999
SmallVector<const User *, 32> Worklist;
@@ -144,12 +144,9 @@ static bool isNonRenamableLocal(const GlobalValue &GV) {
144144

145145
/// Determine whether this call has all constant integer arguments (excluding
146146
/// "this") and summarize it to VCalls or ConstVCalls as appropriate.
147-
static void addVCallToSet(
148-
DevirtCallSite Call, GlobalValue::GUID Guid,
149-
SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
150-
&VCalls,
151-
SetVector<FunctionSummary::ConstVCall,
152-
std::vector<FunctionSummary::ConstVCall>> &ConstVCalls) {
147+
static void addVCallToSet(DevirtCallSite Call, GlobalValue::GUID Guid,
148+
SetVector<FunctionSummary::VFuncId> &VCalls,
149+
SetVector<FunctionSummary::ConstVCall> &ConstVCalls) {
153150
std::vector<uint64_t> Args;
154151
// Start from the second argument to skip the "this" pointer.
155152
for (auto &Arg : drop_begin(Call.CB.args())) {
@@ -166,18 +163,11 @@ static void addVCallToSet(
166163
/// If this intrinsic call requires that we add information to the function
167164
/// summary, do so via the non-constant reference arguments.
168165
static void addIntrinsicToSummary(
169-
const CallInst *CI,
170-
SetVector<GlobalValue::GUID, std::vector<GlobalValue::GUID>> &TypeTests,
171-
SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
172-
&TypeTestAssumeVCalls,
173-
SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
174-
&TypeCheckedLoadVCalls,
175-
SetVector<FunctionSummary::ConstVCall,
176-
std::vector<FunctionSummary::ConstVCall>>
177-
&TypeTestAssumeConstVCalls,
178-
SetVector<FunctionSummary::ConstVCall,
179-
std::vector<FunctionSummary::ConstVCall>>
180-
&TypeCheckedLoadConstVCalls,
166+
const CallInst *CI, SetVector<GlobalValue::GUID> &TypeTests,
167+
SetVector<FunctionSummary::VFuncId> &TypeTestAssumeVCalls,
168+
SetVector<FunctionSummary::VFuncId> &TypeCheckedLoadVCalls,
169+
SetVector<FunctionSummary::ConstVCall> &TypeTestAssumeConstVCalls,
170+
SetVector<FunctionSummary::ConstVCall> &TypeCheckedLoadConstVCalls,
181171
DominatorTree &DT) {
182172
switch (CI->getCalledFunction()->getIntrinsicID()) {
183173
case Intrinsic::type_test:
@@ -279,14 +269,12 @@ static void computeFunctionSummary(
279269
MapVector<ValueInfo, CalleeInfo, DenseMap<ValueInfo, unsigned>,
280270
std::vector<std::pair<ValueInfo, CalleeInfo>>>
281271
CallGraphEdges;
282-
SetVector<ValueInfo, std::vector<ValueInfo>> RefEdges, LoadRefEdges,
283-
StoreRefEdges;
284-
SetVector<GlobalValue::GUID, std::vector<GlobalValue::GUID>> TypeTests;
285-
SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
286-
TypeTestAssumeVCalls, TypeCheckedLoadVCalls;
287-
SetVector<FunctionSummary::ConstVCall,
288-
std::vector<FunctionSummary::ConstVCall>>
289-
TypeTestAssumeConstVCalls, TypeCheckedLoadConstVCalls;
272+
SetVector<ValueInfo> RefEdges, LoadRefEdges, StoreRefEdges;
273+
SetVector<GlobalValue::GUID> TypeTests;
274+
SetVector<FunctionSummary::VFuncId> TypeTestAssumeVCalls,
275+
TypeCheckedLoadVCalls;
276+
SetVector<FunctionSummary::ConstVCall> TypeTestAssumeConstVCalls,
277+
TypeCheckedLoadConstVCalls;
290278
ICallPromotionAnalysis ICallAnalysis;
291279
SmallPtrSet<const User *, 8> Visited;
292280

@@ -517,7 +505,7 @@ static void computeFunctionSummary(
517505
std::vector<ValueInfo> Refs;
518506
if (IsThinLTO) {
519507
auto AddRefEdges = [&](const std::vector<const Instruction *> &Instrs,
520-
SetVector<ValueInfo, std::vector<ValueInfo>> &Edges,
508+
SetVector<ValueInfo> &Edges,
521509
SmallPtrSet<const User *, 8> &Cache) {
522510
for (const auto *I : Instrs) {
523511
Cache.erase(I);
@@ -722,7 +710,7 @@ static void computeVariableSummary(ModuleSummaryIndex &Index,
722710
DenseSet<GlobalValue::GUID> &CantBePromoted,
723711
const Module &M,
724712
SmallVectorImpl<MDNode *> &Types) {
725-
SetVector<ValueInfo, std::vector<ValueInfo>> RefEdges;
713+
SetVector<ValueInfo> RefEdges;
726714
SmallPtrSet<const User *, 8> Visited;
727715
bool HasBlockAddress = findRefEdges(Index, &V, RefEdges, Visited);
728716
bool NonRenamableLocal = isNonRenamableLocal(V);

llvm/tools/llvm-reduce/deltas/ReduceOperandsSkip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ opportunities(Function &F,
155155

156156
// After all candidates have been added, it doesn't need to be a set
157157
// anymore.
158-
auto Candidates = ReferencedVals.takeVector();
158+
std::vector<Value *> Candidates = ReferencedVals.takeVector();
159159

160160
// Remove ineligible candidates.
161161
llvm::erase_if(Candidates, [&, OpVal](Value *V) {

mlir/include/mlir/Support/LLVM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ template <typename KeyT, typename ValueT,
122122
using DenseMap = llvm::DenseMap<KeyT, ValueT, KeyInfoT, BucketT>;
123123
template <typename ValueT, typename ValueInfoT = DenseMapInfo<ValueT>>
124124
using DenseSet = llvm::DenseSet<ValueT, ValueInfoT>;
125-
template <typename T, typename Vector = llvm::SmallVector<T, 0>,
125+
template <typename T, typename Vector = std::vector<T>,
126126
typename Set = DenseSet<T>, unsigned N = 0>
127127
using SetVector = llvm::SetVector<T, Vector, Set, N>;
128128
template <typename AllocatorTy = llvm::MallocAllocator>

mlir/lib/Analysis/SliceAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void mlir::getForwardSlice(Operation *op, SetVector<Operation *> *forwardSlice,
6262
// Reverse to get back the actual topological order.
6363
// std::reverse does not work out of the box on SetVector and I want an
6464
// in-place swap based thing (the real std::reverse, not the LLVM adapter).
65-
SmallVector<Operation *, 0> v(forwardSlice->takeVector());
65+
std::vector<Operation *> v(forwardSlice->takeVector());
6666
forwardSlice->insert(v.rbegin(), v.rend());
6767
}
6868

@@ -74,7 +74,7 @@ void mlir::getForwardSlice(Value root, SetVector<Operation *> *forwardSlice,
7474
// Reverse to get back the actual topological order.
7575
// std::reverse does not work out of the box on SetVector and I want an
7676
// in-place swap based thing (the real std::reverse, not the LLVM adapter).
77-
SmallVector<Operation *, 0> v(forwardSlice->takeVector());
77+
std::vector<Operation *> v(forwardSlice->takeVector());
7878
forwardSlice->insert(v.rbegin(), v.rend());
7979
}
8080

0 commit comments

Comments
 (0)