[PATCH] D138287: [clang][RISCV] Drop caching from RVVType as it introduces data races

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 05:01:50 PST 2022


kadircet created this revision.
kadircet added reviewers: kito-cheng, ilya-biryukov.
Herald added subscribers: sunshaoce, VincentWu, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, arichardson.
Herald added a project: All.
kadircet requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: clang.

As brought up in https://reviews.llvm.org/D124730#inline-1326968, this
logic is used in places that are supposed to be thread-safe. Unfortunately
putting a single mutex around these maps also wouldn't solve the issue because
RVVType itself is mutable. So I see no other option but to drop the caches &
pass-by-reference logic completely, this likely has performance implications.
Whoever owns this probably should figure out a thread-safe place to store these
instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138287

Files:
  clang/include/clang/Support/RISCVVIntrinsicUtils.h
  clang/lib/Sema/SemaRISCVVectorLookup.cpp
  clang/lib/Support/RISCVVIntrinsicUtils.cpp
  clang/utils/TableGen/RISCVVEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138287.476430.patch
Type: text/x-patch
Size: 7246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221118/75d8edac/attachment.bin>


More information about the cfe-commits mailing list