Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5 |
|
#
875b10f7 |
| 22-Nov-2024 |
Pengcheng Wang <wangpengcheng.pp@bytedance.com> |
[RISCV] Support __builtin_cpu_is
We have defined `__riscv_cpu_model` variable in #101449. It contains `mvendorid`, `marchid` and `mimpid` fields which are read via system call `sys_riscv_hwprobe`.
[RISCV] Support __builtin_cpu_is
We have defined `__riscv_cpu_model` variable in #101449. It contains `mvendorid`, `marchid` and `mimpid` fields which are read via system call `sys_riscv_hwprobe`.
We can support `__builtin_cpu_is` via comparing values in compiler's CPU definitions and `__riscv_cpu_model`.
This depends on #116202.
Reviewers: lenary, BeMg, kito-cheng, preames, lukel97
Reviewed By: lenary
Pull Request: https://github.com/llvm/llvm-project/pull/116231
show more ...
|
#
4da960b8 |
| 22-Nov-2024 |
Pengcheng Wang <wangpengcheng.pp@bytedance.com> |
[RISCV] Add mvendorid/marchid/mimpid to CPU definitions (#116202)
We can get these information via `sys_riscv_hwprobe`.
This can be used to implement `__builtin_cpu_is`.
|
#
d1dae1e8 |
| 22-Nov-2024 |
Mikhail Goncharov <goncharov.mikhail@gmail.com> |
Revert "[RISCV] Add mvendorid/marchid/mimpid to CPU definitions (#116202)" chain
This reverts commit b36fcf4f493ad9d30455e178076d91be99f3a7d8. This reverts commit c11b6b1b8af7454b35eef342162dc2cddf5
Revert "[RISCV] Add mvendorid/marchid/mimpid to CPU definitions (#116202)" chain
This reverts commit b36fcf4f493ad9d30455e178076d91be99f3a7d8. This reverts commit c11b6b1b8af7454b35eef342162dc2cddf54b4de. This reverts commit 775148f2367600f90d28684549865ee9ea2f11be.
multiple bot build breakages, e.g. https://lab.llvm.org/buildbot/#/builders/3/builds/8076
show more ...
|
#
b36fcf4f |
| 22-Nov-2024 |
Wang Pengcheng <wangpengcheng.pp@bytedance.com> |
[RISCV] Rename variable CPUModel to Model
The variable name can't be the same as the struct name or we will have "error: declaration of ‘llvm::RISCV::CPUModel llvm::RISCV::CPUInfo::CPUModel’ changes
[RISCV] Rename variable CPUModel to Model
The variable name can't be the same as the struct name or we will have "error: declaration of ‘llvm::RISCV::CPUModel llvm::RISCV::CPUInfo::CPUModel’ changes meaning of ‘CPUModel’ [-fpermissive]".
show more ...
|
#
c11b6b1b |
| 22-Nov-2024 |
Pengcheng Wang <wangpengcheng.pp@bytedance.com> |
[RISCV] Support __builtin_cpu_is
We have defined `__riscv_cpu_model` variable in #101449. It contains `mvendorid`, `marchid` and `mimpid` fields which are read via system call `sys_riscv_hwprobe`.
[RISCV] Support __builtin_cpu_is
We have defined `__riscv_cpu_model` variable in #101449. It contains `mvendorid`, `marchid` and `mimpid` fields which are read via system call `sys_riscv_hwprobe`.
We can support `__builtin_cpu_is` via comparing values in compiler's CPU definitions and `__riscv_cpu_model`.
This depends on #116202.
Reviewers: lenary, BeMg, kito-cheng, preames, lukel97
Reviewed By: lenary
Pull Request: https://github.com/llvm/llvm-project/pull/116231
show more ...
|
#
775148f2 |
| 22-Nov-2024 |
Pengcheng Wang <wangpengcheng.pp@bytedance.com> |
[RISCV] Add mvendorid/marchid/mimpid to CPU definitions (#116202)
We can get these information via `sys_riscv_hwprobe`.
This can be used to implement `__builtin_cpu_is`.
|
#
4d6d5631 |
| 20-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[TargetParser] Remove unused includes (NFC) (#116929)
Identified with misc-include-cleaner.
|
Revision tags: llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
8dafbb5f |
| 22-Jul-2024 |
Jie Fu <jiefu@tencent.com> |
[RISCV] Remove unused function (NFC)
/llvm-project/llvm/lib/TargetParser/RISCVTargetParser.cpp:148:1: error: unused function 'getExtensionBitmask' [-Werror,-Wunused-function] getExtensionBitmask(Str
[RISCV] Remove unused function (NFC)
/llvm-project/llvm/lib/TargetParser/RISCVTargetParser.cpp:148:1: error: unused function 'getExtensionBitmask' [-Werror,-Wunused-function] getExtensionBitmask(StringRef ExtName) { ^ 1 error generated.
show more ...
|
#
f4d4ce1a |
| 22-Jul-2024 |
Piyou Chen <piyou.chen@sifive.com> |
[RISCV] Add groupid/bitmask for RISC-V extension (#94440)
Base on https://github.com/riscv-non-isa/riscv-c-api-doc/pull/74.
This patch defines the groupid/bitmask in RISCVFeatures.td and generate
[RISCV] Add groupid/bitmask for RISC-V extension (#94440)
Base on https://github.com/riscv-non-isa/riscv-c-api-doc/pull/74.
This patch defines the groupid/bitmask in RISCVFeatures.td and generates
the corresponding table in RISCVTargetParserDef.inc.
The groupid/bitmask of extensions provides an abstraction layer between
the compiler and runtime functions.
show more ...
|
#
73acf8d7 |
| 14-Jul-2024 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Add -m[no-]scalar-strict-align and -m[no-]vector-strict-align. (#95024)
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5 |
|
#
733a8778 |
| 23-Apr-2024 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Split code that tablegen needs out of RISCVISAInfo. (#89684)
This introduces a new file, RISCVISAUtils.cpp and moves the rest of
RISCVISAInfo to the TargetParser library.
This will allow
[RISCV] Split code that tablegen needs out of RISCVISAInfo. (#89684)
This introduces a new file, RISCVISAUtils.cpp and moves the rest of
RISCVISAInfo to the TargetParser library.
This will allow us to generate part of RISCVISAInfo.cpp using tablegen.
show more ...
|
Revision tags: llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1 |
|
#
85388a06 |
| 06-Mar-2024 |
Wang Pengcheng <wangpengcheng.pp@bytedance.com> |
[RISCV] Move RISCVVType namespace to TargetParser (#83222)
Clang and some middle-end optimizations may need these helper functions.
This can reduce some duplications.
|
#
8fd011ec |
| 01-Mar-2024 |
Brandon Wu <brandon.wu@sifive.com> |
[RISCV] Add getFeaturesForCPU function support (#83269)
This function parse the cpu and return it's supported
features placed in EnabledFeatures. It is same as the
one in X86TargetParser and also
[RISCV] Add getFeaturesForCPU function support (#83269)
This function parse the cpu and return it's supported
features placed in EnabledFeatures. It is same as the
one in X86TargetParser and also is used in IREE.
show more ...
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5 |
|
#
75d6795e |
| 07-Nov-2023 |
Yeting Kuo <46629943+yetingk@users.noreply.github.com> |
[RISCV][Clang][TargetParser] Support getting feature unaligned-scalar-mem from mcpu. (#71513)
This patch reference ac1ffd3caca12c254e0b8c847aa8ce8e51b6cfbf to suppot
a soft coding way to identify w
[RISCV][Clang][TargetParser] Support getting feature unaligned-scalar-mem from mcpu. (#71513)
This patch reference ac1ffd3caca12c254e0b8c847aa8ce8e51b6cfbf to suppot
a soft coding way to identify whether a cpu has a feature
`unaligned-scalar-mem` by `RISCVProcessors.td`.
This patch does not provide test case since there is no risc-v cpu
support `unaligned-scalar-mem` in llvm upstream now.
show more ...
|
Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3 |
|
#
04fc02e5 |
| 01-May-2023 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Don't store CPUKind in CPUInfo. NFC
This field is never used today. If you have a pointer to the row you can find the CPUKind by subtracting the pointer from the start of the array.
|
#
09f6bdda |
| 01-May-2023 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Remove INVALID from the list of CPUs in RISCVTargetParser. NFC
This value is never used outside and is only used as a sentinel internally which we can solve with other means.
|
#
ddafabea |
| 01-May-2023 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Remove or simplify some StringSwitches in RISCVTargetParser.cpp. NFC
We can iterate over the RISCVCPUInfo table instead of using a separate StringSwitch.
|
#
fa42e7b6 |
| 01-May-2023 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Merge RISCV::parseCPUKind and RISCV::checkCPUKind.
Similar for RISCV::parseTuneCPU and RISCV::checkTuneCPUKind.
This makes the CPUKind enum no longer part of the API. It wasn't providing mu
[RISCV] Merge RISCV::parseCPUKind and RISCV::checkCPUKind.
Similar for RISCV::parseTuneCPU and RISCV::checkTuneCPUKind.
This makes the CPUKind enum no longer part of the API. It wasn't providing much value. It was only used to pass between the two functions.
By removing it, we can remove a dependency on a tablegen generated file from the RISCVTargetParser.h file. Then we can remove a dependency from several CMakeLists.txt.
show more ...
|
Revision tags: llvmorg-16.0.2, llvmorg-16.0.1 |
|
#
aa1d2693 |
| 20-Mar-2023 |
Paul Kirth <paulkirth@google.com> |
[CodeGen][RISCV] Change Shadow Call Stack Register to X3
ShadowCallStack implementation uses s2 register on RISC-V, but that choice is problematic for reasons described in:
https://lists.riscv.org/
[CodeGen][RISCV] Change Shadow Call Stack Register to X3
ShadowCallStack implementation uses s2 register on RISC-V, but that choice is problematic for reasons described in:
https://lists.riscv.org/g/sig-toolchains/message/544, https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/370, and https://github.com/google/android-riscv64/issues/72
The concern over the register choice was also brought up in https://reviews.llvm.org/D84414.
https://reviews.llvm.org/D84414#2228666 said:
``` "If the register choice is the only concern about this work, then I think we can probably land it as-is and fixup the register choice if we see major drawbacks later. Yes, it's an ABI issue, but on the other hand the shadow call stack is not a standard ABI anyway."" ```
Since we have now found a sufficient reason to fixup the register choice, we should go ahead and update the implementation. We propose using x3(gp) which is now the platform register in the RISC-V ABI.
Reviewed By: asb, hiraditya, mcgrathr, craig.topper
Differential Revision: https://reviews.llvm.org/D146463
show more ...
|
#
5e2d8a35 |
| 11-Apr-2023 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Remove getCPUFeaturesExceptStdExt.
This function was used to force +64bit or -64bit into the feature string basd on -mcpu.
It's not entirely clear to me why this was needed. This informati
[RISCV] Remove getCPUFeaturesExceptStdExt.
This function was used to force +64bit or -64bit into the feature string basd on -mcpu.
It's not entirely clear to me why this was needed. This informationo is redundant with the triple. RISCVTargetInfo::initFeatureMap independently recomputes it from the triple for the feature map.
It is ultimately needed in the backend, but that should be handled by RISCVSubtarget processing the CPU name.
Differential Revision: https://reviews.llvm.org/D147978
show more ...
|
#
29463612 |
| 27-Mar-2023 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Replace RISCV -> RISC-V in comments. NFC
To be consistent with RISC-V branding guidelines https://riscv.org/about/risc-v-branding-guidelines/ Think we should be using RISC-V where possible.
[RISCV] Replace RISCV -> RISC-V in comments. NFC
To be consistent with RISC-V branding guidelines https://riscv.org/about/risc-v-branding-guidelines/ Think we should be using RISC-V where possible.
More patches will follow.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D146449
show more ...
|
Revision tags: llvmorg-16.0.0 |
|
#
9d0e5e79 |
| 15-Mar-2023 |
AdityaK <1894981+hiraditya@users.noreply.github.com> |
[RISCV] Reserve X18 by default for Android
Reserve X18 even when -fsanitize=shadow-call-stack is not enabled.
Based on: https://reviews.llvm.org/D143355
Reviewed by: asb, samitolvanen, phosek, Mas
[RISCV] Reserve X18 by default for Android
Reserve X18 even when -fsanitize=shadow-call-stack is not enabled.
Based on: https://reviews.llvm.org/D143355
Reviewed by: asb, samitolvanen, phosek, MaskRay
Differential Revision: https://reviews.llvm.org/D145999
show more ...
|
Revision tags: llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2 |
|
#
03ff435d |
| 06-Feb-2023 |
Roland McGrath <mcgrathr@google.com> |
[RISCV] Default to -ffixed-x18 for Fuchsia
Fuchsia's ABI always reserves the x18 (s2) register for the ShadowCallStack ABI, even when -fsanitize=shadow-call-stack is not enabled.
Reviewed By: phose
[RISCV] Default to -ffixed-x18 for Fuchsia
Fuchsia's ABI always reserves the x18 (s2) register for the ShadowCallStack ABI, even when -fsanitize=shadow-call-stack is not enabled.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D143355
show more ...
|
Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init |
|
#
0ccbf911 |
| 20-Jan-2023 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Remove Features from CPUInfo in RISCVTargetParser.
Instead of having separate feature bits, get information from march. Invalid is now implied by empty march. 64-bit is now implied by march
[RISCV] Remove Features from CPUInfo in RISCVTargetParser.
Instead of having separate feature bits, get information from march. Invalid is now implied by empty march. 64-bit is now implied by march starting with "rv64".
Reviewed By: fpetrogalli
Differential Revision: https://reviews.llvm.org/D142230
show more ...
|
Revision tags: llvmorg-15.0.7 |
|
#
ac1ffd3c |
| 11-Jan-2023 |
Francesco Petrogalli <francesco.petrogalli@apple.com> |
[TargetParser] Generate the defs for RISCV CPUs using llvm-tblgen.
Rework the change to prevent build failures. NFCI.
The failing code was submitted as cf7a8305a2b4ddfd299c748136cb9a2960ef7089 and
[TargetParser] Generate the defs for RISCV CPUs using llvm-tblgen.
Rework the change to prevent build failures. NFCI.
The failing code was submitted as cf7a8305a2b4ddfd299c748136cb9a2960ef7089 and reverted via 8bd65e535fb33bc48805bafed8217b16a853e158.
The rework in this new commit prevents failures like the following:
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/RISCV.cpp.o /usr/bin/c++ [bunch of non interesting stuff] -c <path-to>/llvm-project/clang/lib/Basic/Targets/RISCV.cpp In file included from <path-to>/llvm-project/clang/lib/Basic/Targets/RISCV.cpp:19: <path-to>/llvm-project/llvm/include/llvm/TargetParser/RISCVTargetParser.h:29:10: fatal error: llvm/TargetParser/RISCVTargetParserDef.inc: No such file or directory 29 | #include "llvm/TargetParser/RISCVTargetParserDef.inc" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These failures happen because the library LLVMTargetParser depends on RISCVTargetParserTableGen, which is a tablegen target that generates the list of CPUs in llvm/TargetParser/RISCVTargetParserDef.inc. This *.inc file is included by the public header file llvm/TargetParser/RISCVTargetParser.h.
The header file llvm/TargetParser/RISCVTargetParser.h is also used in components (clangDriver and clangBasic) that link into LLVMTargetParser, but on some configurations such components might end up being built before TargetParser is ready.
The fix is to make sure that clangDriver and clangBasic depend on the tablegen target RISCVTargetParserTableGen, which generates the .inc file whether or not LLVMTargetParser is ready.
WRT the original patch at https://reviews.llvm.org/D137517, this commit is just adding RISCVTargetParserTableGen in the DEPENDS list of clangDriver and clangBasic.
show more ...
|