[Mlir-commits] [mlir] [MLIR][NVVM] Improve inline_ptx, add readwrite support (PR #154358)

Durgadoss R llvmlistbot at llvm.org
Wed Aug 20 05:05:50 PDT 2025


================
@@ -59,19 +62,36 @@ static char getRegisterType(Value v) {
   return getRegisterType(v.getType());
 }
 
+/// Extract every element of a struct value.
+static SmallVector<Value> extractStructElements(PatternRewriter &rewriter,
+                                                Location loc, Value agg) {
+  auto structTy = cast<LLVM::LLVMStructType>(agg.getType());
+  SmallVector<Value> elems;
+  elems.reserve(structTy.getBody().size());
+  for (auto [i, t] : llvm::enumerate(structTy.getBody())) {
+    (void)t;
+    Value e = LLVM::ExtractValueOp::create(rewriter, loc, agg, i);
----------------
durga4github wrote:

If all we need is just the indices here (`i`), can we not loop from 0 to size()?
(or, am I missing some detail?)

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


More information about the Mlir-commits mailing list