diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h --- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h +++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h @@ -14,6 +14,7 @@ #ifndef LLVM_ANALYSIS_BLOCKFREQUENCYINFOIMPL_H #define LLVM_ANALYSIS_BLOCKFREQUENCYINFOIMPL_H +#include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/GraphTraits.h" @@ -1451,7 +1452,7 @@ // frequencies need to be updated based on the incoming edges. // The set is dynamic and changes after every update. Initially all blocks // with a positive frequency are active - auto IsActive = std::vector(Freq.size(), false); + auto IsActive = BitVector(Freq.size(), false); std::queue ActiveSet; for (size_t I = 0; I < Freq.size(); I++) { if (Freq[I] > 0) { diff --git a/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp b/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp --- a/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp +++ b/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp @@ -15,6 +15,7 @@ #if defined(LLVM_HAVE_TF_API) #include "llvm/Analysis/CallGraph.h" +#include "llvm/ADT/BitVector.h" #include "llvm/Analysis/InlineSizeEstimatorAnalysis.h" #include "llvm/Analysis/MLInlineAdvisor.h" #include "llvm/Analysis/ModelUnderTrainingRunner.h" @@ -112,7 +113,7 @@ StringRef LogFileName; const ModelUnderTrainingRunner *const MUTR; std::unique_ptr L; - std::vector Effects; + BitVector Effects; /// There's at least one output. We'll set this to a different value if MUTR /// is avaliable. size_t OutputCount = 1; diff --git a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp --- a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp +++ b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp @@ -13,6 +13,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/BitVector.h" #include "llvm/Transforms/Utils/SampleProfileInference.h" #include "llvm/Support/Debug.h" #include @@ -309,7 +310,7 @@ private: void joinIsolatedComponents() { // Find blocks that are reachable from the source - auto Visited = std::vector(NumBlocks(), false); + auto Visited = BitVector(NumBlocks(), false); findReachable(Func.Entry, Visited); // Iterate over all non-reachable blocks and adjust their weights @@ -334,7 +335,7 @@ /// Run BFS from a given block along the jumps with a positive flow and mark /// all reachable blocks. - void findReachable(uint64_t Src, std::vector &Visited) { + void findReachable(uint64_t Src, BitVector &Visited) { if (Visited[Src]) return; std::queue Queue; @@ -488,7 +489,7 @@ std::vector &UnknownSuccs) { // Run BFS from SrcBlock and make sure all paths are going through unknown // blocks and end at a non-unknown DstBlock - auto Visited = std::vector(NumBlocks(), false); + auto Visited = BitVector(NumBlocks(), false); std::queue Queue; DstBlock = nullptr; @@ -800,7 +801,7 @@ // Run BFS from the source along edges with positive flow std::queue Queue; - auto Visited = std::vector(NumBlocks, false); + auto Visited = BitVector(NumBlocks, false); Queue.push(Func.Entry); Visited[Func.Entry] = true; while (!Queue.empty()) { diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp --- a/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/llvm/tools/llvm-lto/llvm-lto.cpp @@ -267,7 +267,7 @@ namespace { struct ModuleInfo { - std::vector CanBeHidden; + BitVector CanBeHidden; }; } // end anonymous namespace diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp b/llvm/tools/llvm-rc/ResourceScriptParser.cpp --- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp +++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp @@ -741,7 +741,7 @@ // possibly preceded by a comma. Unfortunately, the tool behavior depends // on them existing or not, so we need to memorize where we found them. std::vector Values; - std::vector PrecedingCommas; + BitVector PrecedingCommas; RETURN_IF_ERROR(consumeType(Kind::Comma)); while (!isNextTokenKind(Kind::Identifier) && !isNextTokenKind(Kind::BlockEnd)) { diff --git a/llvm/tools/llvm-rc/ResourceScriptStmt.h b/llvm/tools/llvm-rc/ResourceScriptStmt.h --- a/llvm/tools/llvm-rc/ResourceScriptStmt.h +++ b/llvm/tools/llvm-rc/ResourceScriptStmt.h @@ -16,6 +16,7 @@ #include "ResourceScriptToken.h" #include "ResourceVisitor.h" +#include "llvm/ADT/BitVector.h" #include "llvm/ADT/StringSet.h" namespace llvm { @@ -768,10 +769,10 @@ public: StringRef Key; std::vector Values; - std::vector HasPrecedingComma; + BitVector HasPrecedingComma; VersionInfoValue(StringRef InfoKey, std::vector &&Vals, - std::vector &&CommasBeforeVals) + BitVector &&CommasBeforeVals) : Key(InfoKey), Values(std::move(Vals)), HasPrecedingComma(std::move(CommasBeforeVals)) {} raw_ostream &log(raw_ostream &) const override; diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -17,6 +17,7 @@ #include "StackMapPrinter.h" #include "llvm-readobj.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/MapVector.h" @@ -3905,7 +3906,7 @@ for (uint32_t Buc = 0; Buc < SysVHash.nbucket; Buc++) { if (Buckets[Buc] == ELF::STN_UNDEF) continue; - std::vector Visited(SysVHash.nchain); + BitVector Visited(SysVHash.nchain); for (uint32_t Ch = Buckets[Buc]; Ch < SysVHash.nchain; Ch = Chains[Ch]) { if (Ch == ELF::STN_UNDEF) break; @@ -4653,7 +4654,7 @@ // Go over all buckets and and note chain lengths of each bucket (total // unique chain lengths). for (size_t B = 0; B < NBucket; B++) { - std::vector Visited(NChain); + BitVector Visited(NChain); for (size_t C = Buckets[B]; C < NChain; C = Chains[C]) { if (C == ELF::STN_UNDEF) break; diff --git a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp --- a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp +++ b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp @@ -433,7 +433,7 @@ Function *FnAssume = Intrinsic::getDeclaration(Mod.get(), Intrinsic::assume); std::vector ShuffledArgs; - std::vector HasArg; + BitVector HasArg; for (auto &Arg : F->args()) { ShuffledArgs.push_back(&Arg); HasArg.push_back(false); diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h --- a/llvm/utils/TableGen/CodeGenInstruction.h +++ b/llvm/utils/TableGen/CodeGenInstruction.h @@ -13,6 +13,7 @@ #ifndef LLVM_UTILS_TABLEGEN_CODEGENINSTRUCTION_H #define LLVM_UTILS_TABLEGEN_CODEGENINSTRUCTION_H +#include "llvm/ADT/BitVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/MachineValueType.h" #include "llvm/Support/SMLoc.h" @@ -106,7 +107,7 @@ /// DoNotEncode - Bools are set to true in this vector for each operand in /// the DisableEncoding list. These should not be emitted by the code /// emitter. - std::vector DoNotEncode; + BitVector DoNotEncode; /// MIOperandInfo - Default MI operand type. Note an operand may be made /// up of multiple MI operands. diff --git a/llvm/utils/TableGen/GlobalISel/GIMatchTree.h b/llvm/utils/TableGen/GlobalISel/GIMatchTree.h --- a/llvm/utils/TableGen/GlobalISel/GIMatchTree.h +++ b/llvm/utils/TableGen/GlobalISel/GIMatchTree.h @@ -588,7 +588,7 @@ unsigned OpIdx; std::vector TraversedEdges; DenseMap ResultToPartition; - std::vector PartitionToResult; + BitVector PartitionToResult; void addToPartition(bool Result, unsigned LeafIdx);