[all-commits] [llvm/llvm-project] 108864: [Clang] Add clang attribute `clang_builtin_alias`.

Kai Wang via All-commits all-commits at lists.llvm.org
Sat Apr 24 17:49:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 108864397d26ffff39267f417cabc7f248431437
      https://github.com/llvm/llvm-project/commit/108864397d26ffff39267f417cabc7f248431437
  Author: Hsiangkai Wang <kai.wang at sifive.com>
  Date:   2021-04-25 (Sun, 25 Apr 2021)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/AST/Decl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    A clang/test/CodeGen/RISCV/riscv-attr-builtin-alias-err.c
    A clang/test/CodeGen/RISCV/riscv-attr-builtin-alias.c
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test

  Log Message:
  -----------
  [Clang] Add clang attribute `clang_builtin_alias`.

In some cases, we want to provide the alias name for the clang builtins.
For example, the arguments must be constant integers for some RISC-V builtins.
If we use wrapper functions, we could not constrain the arguments be constant
integer. This attribute is used to achieve the purpose.

Besides this, use `clang_builtin_alias` is more efficient than using
wrapper functions. We use this attribute to deal with test time issue
reported in https://bugs.llvm.org/show_bug.cgi?id=49962.

In our downstream testing, it could decrease the testing time from 6.3
seconds to 3.7 seconds for vloxei.c test.

Differential Revision: https://reviews.llvm.org/D100611




More information about the All-commits mailing list