How to add/use parameter attributes? Troubles with "byval"

I'm unable to figure out how IR attributes can be added via the C++ API.
I need to create a function like this:

%1 = call i64 @abi\_call\_test\_tuple\_2p\(%struct\.abi\_tuple\_2p\* byval

align 8 %v)

Where a structure is being passed by value. I need to add the `byval`
attribute somewhere (I'm not clear if this is on the function arguments
or the type).

I'm also uncertain of why that results in a different calling convention
than just:

%1 = call i64 @abi\_call\_test\_tuple\_2p\(%":abi\_tuple\_2" %0\)

Does this not also pass the same structure by-value to the function?
(It doesn't yield the same results it appears).