[PATCH] D100611: [RISCV] Add new attribute __clang_riscv_builtin_alias for intrinsics.

Hsiangkai Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 20 08:34:57 PDT 2021


HsiangKai marked an inline comment as done.
HsiangKai added inline comments.


================
Comment at: clang/include/clang/Basic/AttrDocs.td:2147-2150
+This attribute can only be used to set up the aliases for certain RISC-V
+C intrinsic functions; it is intended for use only inside ``riscv_*.h``
+and is not a general mechanism for declaring arbitrary aliases for
+clang builtin functions.
----------------
aaron.ballman wrote:
> Why a specific attribute for only one architecture rather than a more general solution that can be used for multiple architectures? We already have `__clang_arm_builtin_alias` (with the incorrect name, so I guess I see where you got the __ from) and now we're extending it. I am not certain if there's a reason why we should use a different attribute for each target though.
I agree with you. We should not define the attribute as target specific. This patch is a quick solution to address the issue https://bugs.llvm.org/show_bug.cgi?id=49962.

I will refactor this patch and try to merge it with `__clang_arm_builtin_alias` in some way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100611



More information about the cfe-commits mailing list