[PATCH] D72972: [WebAssembly] Add experimental multivalue calling ABI

Thomas Lively via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 14:54:03 PST 2020


tlively marked 3 inline comments as done.
tlively added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:741
+  explicit WebAssemblyABIInfo(CodeGen::CodeGenTypes &CGT, ABIKind _Kind)
+      : SwiftABIInfo(CGT), defaultInfo(CGT), Kind(_Kind) {}
 
----------------
aheejin wrote:
> Nit: Do we need `_`?
I was cargo culting the ARM targets here. It may be that some compilers get confused when the type and variable have the same name in this situation?


================
Comment at: clang/test/CodeGen/wasm-arguments.c:19
+
 // Structs should be passed byval and not split up.
+// WEBASSEMBLY32: define void @struct_arg(%struct.s1* byval(%struct.s1) align 4 %i)
----------------
aheejin wrote:
> The comment here includes only the MVP case. Shouldn't we update this? Ditto for the other comments below. 
I think there is some value in having the comments describe the expected stable behavior and let the "EXPERIMENTAL" speak for itself. The only thing I can think of adding to the comment is "... in non-experimental ABIs", but that doesn't seem too valuable to have.


================
Comment at: clang/test/CodeGen/wasm-arguments.c:98
+// WEBASSEMBLY64: define void @union_arg(%union.simple_union* byval(%union.simple_union) align 4 %s)
+// EXPERIMENTAL-MV: define void @union_arg(i32 %s.0)
+void union_arg(union simple_union s) {}
----------------
aheejin wrote:
> Why is the union passed as an int for MV?
Unions cannot be represented precisely in LLVM IR. I believe they are just represented as their largest component, as this one is. From an ABI point of view it is either an int or a struct containing a single int, both of which are passed by value in our ABI.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72972/new/

https://reviews.llvm.org/D72972





More information about the cfe-commits mailing list