[Mlir-commits] [mlir] [MLIR][LLVMIR] Preserve byval alignment in memcpy after inlining (PR #185433)

Christian Ulmann llvmlistbot at llvm.org
Mon Mar 9 08:31:28 PDT 2026


================
@@ -570,6 +570,26 @@ llvm.func @test_byval_global() {
 
 // -----
 
+// Check that alignment information is preserved in the memcpy when inlining
+// byval arguments.
+
+llvm.func @byval_aligned_arg(%ptr : !llvm.ptr { llvm.byval = i32, llvm.align = 16 }) {
+  llvm.return
+}
+
+// CHECK-LABEL: llvm.func @test_byval_memcpy_alignment
+// CHECK-SAME: %[[PTR:[a-zA-Z0-9_]+]]: !llvm.ptr
+llvm.func @test_byval_memcpy_alignment(%ptr : !llvm.ptr) {
+  // Verify the memcpy carries the alignment info from the byval attribute.
+  // CHECK: %[[ALLOCA:.+]] = llvm.alloca{{.+}}alignment = 16
----------------
Dinistro wrote:

```suggestion
  // CHECK: %[[ALLOCA:.+]] = llvm.alloca
  // CHECK-SAME: alignment = 16
```

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


More information about the Mlir-commits mailing list