[Clang][SME2] Enable multi-vector loads & stores for SME2 (#75821)
[llvm-project.git] / compiler-rt / lib / tsan / dd / dd_rtl.h
blobc812ffbd1393d30096ef166d455a571a04faf9f2
1 //===-- dd_rtl.h ----------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef DD_RTL_H
9 #define DD_RTL_H
11 #include "sanitizer_common/sanitizer_internal_defs.h"
12 #include "sanitizer_common/sanitizer_deadlock_detector_interface.h"
13 #include "sanitizer_common/sanitizer_flags.h"
14 #include "sanitizer_common/sanitizer_allocator_internal.h"
15 #include "sanitizer_common/sanitizer_addrhashmap.h"
16 #include "sanitizer_common/sanitizer_mutex.h"
18 namespace __dsan {
20 typedef DDFlags Flags;
22 struct UserMutex {
23 DDMutex dd;
26 struct Thread {
27 DDPhysicalThread *dd_pt;
28 DDLogicalThread *dd_lt;
30 bool ignore_interceptors;
33 struct Callback final : public DDCallback {
34 Thread *thr;
36 Callback(Thread *thr);
37 u32 Unwind() override;
40 typedef AddrHashMap<UserMutex, 31051> MutexHashMap;
42 struct Context {
43 DDetector *dd;
45 Mutex report_mutex;
46 MutexHashMap mutex_map;
49 inline Flags* flags() {
50 static Flags flags;
51 return &flags;
54 void Initialize();
55 void InitializeInterceptors();
57 void ThreadInit(Thread *thr);
58 void ThreadDestroy(Thread *thr);
60 void MutexBeforeLock(Thread *thr, uptr m, bool writelock);
61 void MutexAfterLock(Thread *thr, uptr m, bool writelock, bool trylock);
62 void MutexBeforeUnlock(Thread *thr, uptr m, bool writelock);
63 void MutexDestroy(Thread *thr, uptr m);
65 } // namespace __dsan
66 #endif // DD_RTL_H