Skip to content

Commit 6254495

Browse files
committed
[RISCV] Move RVVBitsPerBlock to TargetParser.h so we can use it in clang. NFC
Differential Revision: https://reviews.llvm.org/D137266
1 parent 86f9655 commit 6254495

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

clang/lib/Basic/Targets/RISCV.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ RISCVTargetInfo::getVScaleRange(const LangOptions &LangOpts) const {
255255
if (unsigned MinVLen = ISAInfo->getMinVLen()) {
256256
unsigned MaxVLen = ISAInfo->getMaxVLen();
257257
// RISCV::RVVBitsPerBlock is 64.
258-
return std::pair<unsigned, unsigned>(MinVLen/64, MaxVLen/64);
258+
return std::make_pair(MinVLen / llvm::RISCV::RVVBitsPerBlock,
259+
MaxVLen / llvm::RISCV::RVVBitsPerBlock);
259260
}
260261

261262
return None;

llvm/include/llvm/Support/TargetParser.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ IsaVersion getIsaVersion(StringRef GPU);
157157

158158
namespace RISCV {
159159

160+
// We use 64 bits as the known part in the scalable vector types.
161+
static constexpr unsigned RVVBitsPerBlock = 64;
162+
160163
enum CPUKind : unsigned {
161164
#define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) CK_##ENUM,
162165
#define TUNE_PROC(ENUM, NAME) CK_##ENUM,

llvm/lib/Target/RISCV/RISCVISelLowering.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/CodeGen/CallingConvLower.h"
1919
#include "llvm/CodeGen/SelectionDAG.h"
2020
#include "llvm/CodeGen/TargetLowering.h"
21+
#include "llvm/Support/TargetParser.h"
2122

2223
namespace llvm {
2324
class RISCVSubtarget;
@@ -325,11 +326,6 @@ enum NodeType : unsigned {
325326
};
326327
} // namespace RISCVISD
327328

328-
namespace RISCV {
329-
// We use 64 bits as the known part in the scalable vector types.
330-
static constexpr unsigned RVVBitsPerBlock = 64;
331-
} // namespace RISCV
332-
333329
class RISCVTargetLowering : public TargetLowering {
334330
const RISCVSubtarget &Subtarget;
335331

0 commit comments

Comments
 (0)