[PATCH] D151730: [RISCV] Support target attribute for function

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 2 01:52:36 PDT 2023


kito-cheng added inline comments.


================
Comment at: clang/test/CodeGen/RISCV/riscv-func-attr-target.c:10
+// CHECK-ASM: .option pop
+__attribute__((target("arch=rv64g,+c,+v"))) void test1 () {}
+
----------------
It's ext list or full arch, can't mixed together.

```
ARCH-ATTR   := 'arch=' EXTENSIONS-OR-FULLARCH
EXTENSIONS-OR-FULLARCH := <EXTENSIONS>
                        | <FULLARCHSTR>
```


================
Comment at: clang/test/CodeGen/RISCV/riscv-func-attr-target.c:34
+// CHECK-ASM: .option pop
+__attribute__((target("arch=+experimental-zihintntl"))) void test5 () {}
+
----------------
The extension name is `zihintntl` not `experimental-zihintntl`, I would suggest either drop the experimental extension support or requiring the version number to be specified.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151730



More information about the cfe-commits mailing list