[PATCH] D128726: [RISCV][NFC] Move static global variables into static variable in function.

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 19:30:07 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1b8cde9b6338: [RISCV][NFC] Move static global variables into static variable in function. (authored by kito-cheng).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128726/new/

https://reviews.llvm.org/D128726

Files:
  clang/lib/Support/RISCVVIntrinsicUtils.cpp


Index: clang/lib/Support/RISCVVIntrinsicUtils.cpp
===================================================================
--- clang/lib/Support/RISCVVIntrinsicUtils.cpp
+++ 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<uint64_t, RVVType> LegalTypes;
-static std::set<uint64_t> IllegalTypes;
-
 //===----------------------------------------------------------------------===//
 // Type implementation
 //===----------------------------------------------------------------------===//
@@ -822,6 +818,9 @@
 
 Optional<RVVTypePtr> RVVType::computeType(BasicType BT, int Log2LMUL,
                                           PrototypeDescriptor Proto) {
+  // Concat BasicType, LMUL and Proto as key
+  static std::unordered_map<uint64_t, RVVType> LegalTypes;
+  static std::set<uint64_t> IllegalTypes;
   uint64_t Idx = computeRVVTypeHashValue(BT, Log2LMUL, Proto);
   // Search first
   auto It = LegalTypes.find(Idx);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128726.441232.patch
Type: text/x-patch
Size: 1107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220630/5babb92f/attachment.bin>


More information about the cfe-commits mailing list