[llvm] [NVPTX] Load/Store/Fence syncscope support (PR #106101)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 15:46:58 PDT 2024


================
@@ -18,13 +18,26 @@
 #include "NVPTXISelLowering.h"
 #include "NVPTXRegisterInfo.h"
 #include "NVPTXTargetMachine.h"
+#include "llvm/ADT/MapVector.h"
 #include "llvm/CodeGen/SelectionDAGISel.h"
 #include "llvm/IR/InlineAsm.h"
 #include "llvm/IR/Intrinsics.h"
+#include "llvm/IR/LLVMContext.h"
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
+struct NVPTXScopes {
+  NVPTXScopes() = default;
+  NVPTXScopes(LLVMContext &C);
+  NVPTX::Scope operator[](SyncScope::ID ID) const;
+  bool empty() const;
+
+private:
+  SmallMapVector<SyncScope::ID, NVPTX::Scope, 8> Scopes{};
----------------
Artem-B wrote:

We have exactly 5 scopes here, so we can trim the small vector size down, too. Maybe define enum value for the number of scopes and use that.

https://github.com/llvm/llvm-project/pull/106101


More information about the llvm-commits mailing list