================
@@ -426,28 +444,36 @@ emitStructFieldArgs(mlir::OpBuilder &builder, 
mlir::Location loc,
                     mlir::Value structVal, cir::RecordType recTy,
                     SmallVectorImpl<mlir::Value> &newArgs,
                     SmallVectorImpl<cir::LoadOp> &replacedWholeLoads) {
-  cir::LoadOp wholeLoad = structVal.getDefiningOp<cir::LoadOp>();
-  cir::AllocaOp srcAlloca;
-  if (wholeLoad && !wholeLoad.getIsVolatile() && !wholeLoad.getMemOrder())
-    srcAlloca = wholeLoad.getAddr().getDefiningOp<cir::AllocaOp>();
+  WholeRecordSource src = getWholeRecordSource(structVal);
----------------
erichkeane wrote:


```suggestion
  auto [srcAlloca, srcLoad] = getWholeRecordSource(structVal);
```

https://github.com/llvm/llvm-project/pull/216499
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to