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

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 13:37:53 PDT 2021


pmatos added a comment.

A few data points on the patch. Externrefs live in address space 1 and funcrefs in address space 3. Externref globals live in address space 2 and funcref globals live in address space 4.

On `global.set`, `global.get`:

- The patch creates new nodes for `global.get` and `set`. These nodes are create during lowering of loads (generating `global.get`) and stores (generating `global.set`).
- Selection happens through a Pattern that creates the respective `GLOBAL_SET/GET_EXTERNREF/FUNCREF`.

On lowering of `funcref` calls:

- A new node for table set is created. This is created during the call lowering and added to the chain of the call. Later on it's selected through a Pattern and the instruction `TABLE_SET_FUNCREF` is generated.

On middle end store/load optimizations: LLVM didn't like too much optimizing stores and loads of 0 size, therefore some optimization skipping was put in place so that we don't try to optimize loads and stores when the VT is sizeless.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95425



More information about the llvm-commits mailing list