[PATCH] D135202: [IR] Add a target extension type to LLVM.

Zixuan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 00:16:27 PDT 2023


zixuan-wu added a comment.

@jcranmer-intel hi, have you considered how to design and implement target extension type in clang front-end? For example, one solution is by attribute like following(maybe similar):

  struct {
    int a;
    float b;
  } __attribute__((target_ext_type("spirv.DeviceEvent", int, float)))

Or

  typedef int[M] TType __attribute__((target_ext_type("spirv.DeviceEvent", int, m)))

so that it can specify the underlying type by typedef one original type.

Even with builtin type like following

  typedef __rvv_buitlin_type TType __attribute__((target_ext_type("spirv.DeviceEvent")))


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135202



More information about the llvm-commits mailing list