[llvm] [LangRef] Clarifying the copying behaviour of byval (PR #205576)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 08:49:46 PDT 2026


================
@@ -1357,7 +1357,11 @@ Currently, only the following parameter attributes are defined:
     ``byval`` parameters). This is not a valid attribute for return
     values.
 
-    The byval type argument indicates the in-memory value type.
+    The byval type argument is only used for its allocation size and alignment
----------------
dtcxzyw wrote:

https://github.com/llvm/llvm-project/blob/76ddb39f1b18556b6de86c6cac0ebbb0ed6cb056/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp#L267-L271
https://github.com/llvm/llvm-project/blob/76ddb39f1b18556b6de86c6cac0ebbb0ed6cb056/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp#L11581-L11582
https://github.com/llvm/llvm-project/blob/76ddb39f1b18556b6de86c6cac0ebbb0ed6cb056/llvm/lib/Target/X86/X86ISelLoweringCall.cpp#L1235-L1247

I don't have enough knowledge about this. But it was chosen to match the implementation.


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


More information about the llvm-commits mailing list