diff --git a/clang/lib/Support/RISCVVIntrinsicUtils.cpp b/clang/lib/Support/RISCVVIntrinsicUtils.cpp --- a/clang/lib/Support/RISCVVIntrinsicUtils.cpp +++ b/clang/lib/Support/RISCVVIntrinsicUtils.cpp @@ -31,10 +31,6 @@ const PrototypeDescriptor PrototypeDescriptor::Vector = PrototypeDescriptor(BaseTypeModifier::Vector); -// Concat BasicType, LMUL and Proto as key -static std::unordered_map LegalTypes; -static std::set IllegalTypes; - //===----------------------------------------------------------------------===// // Type implementation //===----------------------------------------------------------------------===// @@ -822,6 +818,9 @@ Optional RVVType::computeType(BasicType BT, int Log2LMUL, PrototypeDescriptor Proto) { + // Concat BasicType, LMUL and Proto as key + static std::unordered_map LegalTypes; + static std::set IllegalTypes; uint64_t Idx = computeRVVTypeHashValue(BT, Log2LMUL, Proto); // Search first auto It = LegalTypes.find(Idx);