Introduce a RVVTypeCache to hold the cache instead of using a local
static variable to maintain a cache.
Also made construct of RVVType to private, make sure that could be only
created by a cache manager.
Paths
| Differential D138429
[clang][RISCV][NFC] Prevent data race in RVVType::computeType ClosedPublic Authored by kito-cheng on Nov 21 2022, 6:42 AM.
Details Summary Introduce a RVVTypeCache to hold the cache instead of using a local Also made construct of RVVType to private, make sure that could be only
Diff Detail
Event TimelineComment Actions LG from a thread-safety perspective, thanks! Approving because it looks mechanically "obviously correct", but you may want to wait for another reviewer to confirm the API changes are sane (I don't really know what this code does or how it's used). This revision is now accepted and ready to land.Nov 21 2022, 6:53 AM Comment Actions thanks! +1 from my side as well for thread-safety purposes (and I hope having 2 separate caches for tablegen and sema doesn't have unexpected effects).
Comment Actions Changes:
kito-cheng added inline comments. This revision was landed with ongoing or failed builds.Nov 23 2022, 12:59 AM Closed by commit rG3fe89be80159: [clang][RISCV][NFC] Prevent data race in RVVType::computeType (authored by kito-cheng). · Explain Why This revision was automatically updated to reflect the committed changes. kito-cheng marked 2 inline comments as done.
Revision Contents
Diff 477408 clang/include/clang/Support/RISCVVIntrinsicUtils.h
clang/lib/Sema/SemaRISCVVectorLookup.cpp
clang/lib/Support/RISCVVIntrinsicUtils.cpp
clang/utils/TableGen/RISCVVEmitter.cpp
|
nit: maybe we could add some comments to said the motivation for RVVTypeCache.