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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 11:54:35 PDT 2024


================
@@ -1189,7 +1283,7 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) {
   std::optional<unsigned> Opcode;
   MVT::SimpleValueType TargetVT = LD->getSimpleValueType(0).SimpleTy;
 
-  SmallVector<SDValue, 12> Ops({getI32Imm(InstructionOrdering, DL),
+  SmallVector<SDValue, 12> Ops({getI32Imm(Ordering, DL), getI32Imm(Scope, DL),
----------------
Artem-B wrote:

We can't use c++26 (I believe LLVM builds w/ c++17 at the moment).

The idea here is to make sure that the default vector size is sufficient to effectively accommodate expected uses.
Presumably previously we expected to see up to 12 elements. Now we've added another. While the array will fall back to the allocation, we do not want that. If we know we may need up to N elements, we should just say so.

There's no need to add any runtime checks, all you need to do is check the code below and see what's the largest number of additional elements we add to the array, and adjust the array size accordingly.

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


More information about the llvm-commits mailing list