[PATCH] D137266: [RISCV] Move RVVBitsPerBlock to TargetParser.h so we can use it in clang. NFC
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 2 09:25:22 PDT 2022
craig.topper created this revision.
craig.topper added reviewers: reames, frasercrmck, rogfer01, kito-cheng.
Herald added subscribers: sunshaoce, VincentWu, StephenFan, vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD, MaskRay.
Herald added projects: clang, LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D137266
Files:
clang/lib/Basic/Targets/RISCV.cpp
llvm/include/llvm/Support/TargetParser.h
llvm/lib/Target/RISCV/RISCVISelLowering.h
Index: llvm/lib/Target/RISCV/RISCVISelLowering.h
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelLowering.h
+++ llvm/lib/Target/RISCV/RISCVISelLowering.h
@@ -18,6 +18,7 @@
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/TargetLowering.h"
+#include "llvm/Support/TargetParser.h"
namespace llvm {
class RISCVSubtarget;
@@ -325,11 +326,6 @@
};
} // namespace RISCVISD
-namespace RISCV {
-// We use 64 bits as the known part in the scalable vector types.
-static constexpr unsigned RVVBitsPerBlock = 64;
-} // namespace RISCV
-
class RISCVTargetLowering : public TargetLowering {
const RISCVSubtarget &Subtarget;
Index: llvm/include/llvm/Support/TargetParser.h
===================================================================
--- llvm/include/llvm/Support/TargetParser.h
+++ llvm/include/llvm/Support/TargetParser.h
@@ -157,6 +157,9 @@
namespace RISCV {
+// We use 64 bits as the known part in the scalable vector types.
+static constexpr unsigned RVVBitsPerBlock = 64;
+
enum CPUKind : unsigned {
#define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) CK_##ENUM,
#define TUNE_PROC(ENUM, NAME) CK_##ENUM,
Index: clang/lib/Basic/Targets/RISCV.cpp
===================================================================
--- clang/lib/Basic/Targets/RISCV.cpp
+++ clang/lib/Basic/Targets/RISCV.cpp
@@ -255,7 +255,8 @@
if (unsigned MinVLen = ISAInfo->getMinVLen()) {
unsigned MaxVLen = ISAInfo->getMaxVLen();
// RISCV::RVVBitsPerBlock is 64.
- return std::pair<unsigned, unsigned>(MinVLen/64, MaxVLen/64);
+ return std::make_pair(MinVLen / llvm::RISCV::RVVBitsPerBlock,
+ MaxVLen / llvm::RISCV::RVVBitsPerBlock);
}
return None;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137266.472648.patch
Type: text/x-patch
Size: 1802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221102/5b77fdd7/attachment.bin>
More information about the llvm-commits
mailing list