This is an archive of the discontinued LLVM Phabricator instance.

[clang][RISCV] Drop caching from RVVType as it introduces data races
AbandonedPublic

Authored by kadircet on Nov 18 2022, 5:01 AM.

Details

Summary

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.

Diff Detail

Event Timeline

kadircet created this revision.Nov 18 2022, 5:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 18 2022, 5:01 AM
kadircet requested review of this revision.Nov 18 2022, 5:01 AM

I think there almost certainly *is* a better way here, but it may be a significant amount of work and we need to get back to a correct state (revert doesn't seem feasible).

Not approving yet in the hope that @kito-cheng (@kito.cheng?) or @khchen can find something better, if we don't hear back I'll stamp in a week or so.

Apparently I missed those comments during llvm dev meeting, I'll figure out a fix soon.

Apparently I missed those comments during llvm dev meeting, I'll figure out a fix soon.

Thanks a lot!

kadircet abandoned this revision.Dec 6 2022, 1:06 AM