[PATCH] D104797: [WebAssembly] Implementation of global.get/set for reftypes in LLVM IR

Paulo Matos via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 2 07:48:08 PDT 2021


pmatos added a comment.

In D104797#2855322 <https://reviews.llvm.org/D104797#2855322>, @pmatos wrote:

> After @arsenm 's commit https://github.com/llvm/llvm-project/commit/990278d026d680942c859be70836ad34a9a716f7, MachineOperands store LLT for size instead of uint64_t and the constructor called from `SelectionDAG::getLoad`, calls `MachineMemOperand` which does:
>
>   : MachineMemOperand(ptrinfo, f,
>                       s == ~UINT64_C(0) ? LLT() : LLT::scalar(8 * s), a,
>                       AAInfo, Ranges, SSID, Ordering, FailureOrdering) {}
>
> Because `s` is zero for reference types, `LLT::scalar(0)` is called, which asserts because scalar LLTs cannot have zero size. Why do we have the check `s == ~UINT64_C(0)`, instead of `ss == UINT64_C(0)` given opaque types and therefore reference types are zero sized?

OK, sort of replying to myself `~UINT64_T(0)` is the size for invalid types. I think at this point we need `LLT` support for opaque types. Maybe we couldn't have opaque types stored in memory but we now can with reference types in WebAssembly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104797



More information about the cfe-commits mailing list