diff options
author | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-02-21 13:08:01 +0800 |
---|---|---|
committer | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-02-21 13:12:14 +0800 |
commit | b8ed69ecc01385c03844e8fa05ba418a5670d322 (patch) | |
tree | dda10574f7ac8cb8a4719a14166ee8e61ad61038 /clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | |
parent | e4057aacc52bf8b352898504be8e7f8190841aac (diff) | |
download | llvm-b8ed69ecc01385c03844e8fa05ba418a5670d322.zip llvm-b8ed69ecc01385c03844e8fa05ba418a5670d322.tar.gz llvm-b8ed69ecc01385c03844e8fa05ba418a5670d322.tar.bz2 |
[RISCV] Support llvm.readsteadycounter intrinsic
This intrinsic was introduced by #81331, which is a lot like
`llvm.readcyclecounter`.
For the RISCV implementation, we rename `ReadCycleWide` pseudo to
`ReadCounterWide` and make it accept two operands (the low and high
parts of the counter). As for legalization and lowering parts, we
reuse the code of `ISD::READCYCLECOUNTER` (make it able to handle
both intrinsics), and we use `time` CSR for `ISD::READSTEADYCOUNTER`.
Tests using Clang builtins are runned on real hardware and it works
as excepted.
Reviewers: asb, MaskRay, dtcxzyw, preames, topperc, jhuber6
Reviewed By: jhuber6, asb, MaskRay, dtcxzyw
Pull Request: https://github.com/llvm/llvm-project/pull/82322
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp')
0 files changed, 0 insertions, 0 deletions