[PATCH] D111617: [RISCV] Lazily add RVV C intrinsics.

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 12 02:36:00 PDT 2021


kito-cheng added inline comments.


================
Comment at: clang/lib/Sema/SemaLookup.cpp:923
+
+  const RVVIntrinsicInfo *Intrinsic = std::find_if(
+      std::begin(RVVIntrinsicInfos), std::end(RVVIntrinsicInfos),
----------------
rogfer01 wrote:
> Not for this patch: I think this table may be a bit large so all lookups (including those that will fail) will be slower after a `#pragma riscv intrinsic vector` is found.
> 
> Filtering them as fast as possible (looking at the spec shows that currently all RVV intrinsics start with `v`) or using some hash table (if too difficult to build at compile time we could build it the first time we get here?) might be something we want to do.
OpenCL using a tablegen-based generator to generate a big swtich table to speed up the lookup rather than linear scan, here is generated file:

https://gist.github.com/kito-cheng/46616c82c0f25e5df31ff5eaa14914ba#file-openclbuiltins-inc-L8055

I think we could using same approach to prevent the slow down.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111617



More information about the cfe-commits mailing list