Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/GlobalMergeFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class GlobalMergeFunc {
/// The suffix used to identify the merged function that parameterizes
/// the constant values. Note that the original function, without this suffix,
/// becomes a thunk supplying contexts to the merged function via parameters.
static constexpr const char MergingInstanceSuffix[] = ".Tgm";
static constexpr char MergingInstanceSuffix[] = ".Tgm";

GlobalMergeFunc(const ModuleSummaryIndex *Index) : Index(Index) {};

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/SandboxIR/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Context {
// Uses a 64-bit integer so we don't have to worry about the unlikely case
// of overflowing a 32-bit counter.
using ValTy = uint64_t;
static constexpr const ValTy InvalidVal = 0;
static constexpr ValTy InvalidVal = 0;

private:
// Default initialization results in an invalid ID.
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/SandboxIR/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ class SwitchInst : public SingleLLVMInstructionImpl<llvm::SwitchInst> {
friend class Context; // For accessing the constructor in create*()

public:
static constexpr const unsigned DefaultPseudoIndex =
static constexpr unsigned DefaultPseudoIndex =
llvm::SwitchInst::DefaultPseudoIndex;

LLVM_ABI static SwitchInst *create(Value *V, BasicBlock *Dest,
Expand Down
8 changes: 4 additions & 4 deletions llvm/include/llvm/SandboxIR/PassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class PassManager : public ParentPass {
Passes.push_back(std::move(Pass));
}

static constexpr const char EndToken = '\0';
static constexpr const char BeginArgsToken = '<';
static constexpr const char EndArgsToken = '>';
static constexpr const char PassDelimToken = ',';
static constexpr char EndToken = '\0';
static constexpr char BeginArgsToken = '<';
static constexpr char EndArgsToken = '>';
static constexpr char PassDelimToken = ',';

/// Parses \p Pipeline as a comma-separated sequence of pass names and sets
/// the pass pipeline, using \p CreatePass to instantiate passes by name.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ void OpenMPIRBuilder::getKernelArgsVector(TargetKernelArgs &KernelArgs,
Value *Version = Builder.getInt32(OMP_KERNEL_ARG_VERSION);
Value *PointerNum = Builder.getInt32(KernelArgs.NumTargetItems);
auto Int32Ty = Type::getInt32Ty(Builder.getContext());
constexpr const size_t MaxDim = 3;
constexpr size_t MaxDim = 3;
Value *ZeroArray = Constant::getNullValue(ArrayType::get(Int32Ty, MaxDim));
Value *Flags = Builder.getInt64(KernelArgs.HasNoWait);

Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Support/UnicodeNameToCodepoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ constexpr const char *const HangulSyllables[][3] = {

// Unicode 15.0
// 3.12 Conjoining Jamo Behavior Common constants
constexpr const char32_t SBase = 0xAC00;
constexpr const uint32_t LCount = 19;
constexpr const uint32_t VCount = 21;
constexpr const uint32_t TCount = 28;
constexpr char32_t SBase = 0xAC00;
constexpr uint32_t LCount = 19;
constexpr uint32_t VCount = 21;
constexpr uint32_t TCount = 28;

static std::size_t findSyllable(StringRef Name, bool Strict,
char &PreviousInName, int &Pos, int Column) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ struct AAAMDGPUClusterDimsFunction : public AAAMDGPUClusterDims {

AMDGPU::ClusterDimsAttr Attr;

static constexpr const char AttrName[] = "amdgpu-cluster-dims";
static constexpr char AttrName[] = "amdgpu-cluster-dims";
};

AAAMDGPUClusterDims &
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6153,7 +6153,7 @@ bool SIInstrInfo::isLegalRegOperand(const MachineInstr &MI, unsigned OpIdx,
// information.
if (AMDGPU::isPackedFP32Inst(MI.getOpcode()) && AMDGPU::isGFX12Plus(ST) &&
MO.isReg() && RI.isSGPRReg(MRI, MO.getReg())) {
constexpr const AMDGPU::OpName OpNames[] = {
constexpr AMDGPU::OpName OpNames[] = {
AMDGPU::OpName::src0, AMDGPU::OpName::src1, AMDGPU::OpName::src2};

for (auto [I, OpName] : enumerate(OpNames)) {
Expand Down Expand Up @@ -6215,8 +6215,8 @@ bool SIInstrInfo::isLegalVSrcOperand(const MachineRegisterInfo &MRI,
bool SIInstrInfo::isLegalGFX12PlusPackedMathFP32Operand(
const MachineRegisterInfo &MRI, const MachineInstr &MI, unsigned SrcN,
const MachineOperand *MO) const {
constexpr const unsigned NumOps = 3;
constexpr const AMDGPU::OpName OpNames[NumOps * 2] = {
constexpr unsigned NumOps = 3;
constexpr AMDGPU::OpName OpNames[NumOps * 2] = {
AMDGPU::OpName::src0, AMDGPU::OpName::src1,
AMDGPU::OpName::src2, AMDGPU::OpName::src0_modifiers,
AMDGPU::OpName::src1_modifiers, AMDGPU::OpName::src2_modifiers};
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ namespace KernelInfo {
// };

#define KERNEL_ENVIRONMENT_IDX(MEMBER, IDX) \
constexpr const unsigned MEMBER##Idx = IDX;
constexpr unsigned MEMBER##Idx = IDX;

KERNEL_ENVIRONMENT_IDX(Configuration, 0)
KERNEL_ENVIRONMENT_IDX(Ident, 1)

#undef KERNEL_ENVIRONMENT_IDX

#define KERNEL_ENVIRONMENT_CONFIGURATION_IDX(MEMBER, IDX) \
constexpr const unsigned MEMBER##Idx = IDX;
constexpr unsigned MEMBER##Idx = IDX;

KERNEL_ENVIRONMENT_CONFIGURATION_IDX(UseGenericStateMachine, 0)
KERNEL_ENVIRONMENT_CONFIGURATION_IDX(MayUseNestedParallelism, 1)
Expand Down Expand Up @@ -258,7 +258,7 @@ KERNEL_ENVIRONMENT_CONFIGURATION_GETTER(MaxTeams)

GlobalVariable *
getKernelEnvironementGVFromKernelInitCB(CallBase *KernelInitCB) {
constexpr const int InitKernelEnvironmentArgNo = 0;
constexpr int InitKernelEnvironmentArgNo = 0;
return cast<GlobalVariable>(
KernelInitCB->getArgOperand(InitKernelEnvironmentArgNo)
->stripPointerCasts());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ template <char NsanTypeId>
class ShadowTypeConfigImpl : public ShadowTypeConfig {
public:
char getNsanTypeId() const override { return NsanTypeId; }
static constexpr const char kNsanTypeId = NsanTypeId;
static constexpr char kNsanTypeId = NsanTypeId;
};

// `double` (`d`) shadow type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void MemDGNode::print(raw_ostream &OS, bool PrintDeps) const {
DGNode::print(OS, false);
if (PrintDeps) {
// Print memory preds.
static constexpr const unsigned Indent = 4;
static constexpr unsigned Indent = 4;
for (auto *Pred : MemPreds)
OS.indent(Indent) << "<-" << *Pred->getInstruction() << "\n";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ static cl::opt<bool>
"emit new instructions (*very* expensive)."));
#endif // NDEBUG

static constexpr const unsigned long StopAtDisabled =
static constexpr unsigned long StopAtDisabled =
std::numeric_limits<unsigned long>::max();
static cl::opt<unsigned long>
StopAt("sbvec-stop-at", cl::init(StopAtDisabled), cl::Hidden,
cl::desc("Vectorize if the invocation count is < than this. 0 "
"disables vectorization."));

static constexpr const unsigned long StopBundleDisabled =
static constexpr unsigned long StopBundleDisabled =
std::numeric_limits<unsigned long>::max();
static cl::opt<unsigned long>
StopBundle("sbvec-stop-bndl", cl::init(StopBundleDisabled), cl::Hidden,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cl::opt<std::string> AllowFiles(
"sbvec-allow-files", cl::init(".*"), cl::Hidden,
cl::desc("Run the vectorizer only on file paths that match any in the "
"list of comma-separated regex's."));
static constexpr const char AllowFilesDelim = ',';
static constexpr char AllowFilesDelim = ',';

SandboxVectorizerPass::SandboxVectorizerPass() : FPM("fpm") {
if (UserDefinedPassPipeline == DefaultPipelineMagicStr) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace {

// Use X19 as the loop counter register since it's a callee-saved register
// that's available for temporary use.
constexpr const MCPhysReg kDefaultLoopCounterReg = AArch64::X19;
constexpr MCPhysReg kDefaultLoopCounterReg = AArch64::X19;

class ExegesisAArch64Target : public ExegesisTarget {
public:
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-exegesis/lib/Analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void Analysis::printClusterRawHtml(const BenchmarkClustering::ClusterId &Id,

} // namespace exegesis

static constexpr const char kHtmlHead[] = R"(
static constexpr char kHtmlHead[] = R"(
<head>
<title>llvm-exegesis Analysis Results</title>
<style>
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-exegesis/lib/Assembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
namespace llvm {
namespace exegesis {

static constexpr const char ModuleID[] = "ExegesisInfoTest";
static constexpr const char FunctionID[] = "foo";
static constexpr char ModuleID[] = "ExegesisInfoTest";
static constexpr char FunctionID[] = "foo";
static const Align kFunctionAlignment(4096);

// Fills the given basic block with register setup code, and returns true if
Expand Down
10 changes: 5 additions & 5 deletions llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"

static constexpr const char kIntegerPrefix[] = "i_0x";
static constexpr const char kDoublePrefix[] = "f_";
static constexpr const char kInvalidOperand[] = "INVALID";
static constexpr char kIntegerPrefix[] = "i_0x";
static constexpr char kDoublePrefix[] = "f_";
static constexpr char kInvalidOperand[] = "INVALID";

namespace llvm {

Expand Down Expand Up @@ -245,8 +245,8 @@ template <> struct SequenceElementTraits<exegesis::RegisterValue> {
};

template <> struct ScalarTraits<exegesis::RegisterValue> {
static constexpr const unsigned kRadix = 16;
static constexpr const bool kSigned = false;
static constexpr unsigned kRadix = 16;
static constexpr bool kSigned = false;

static void output(const exegesis::RegisterValue &RV, void *Ctx,
raw_ostream &Out) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class InProcessFunctionExecutorImpl : public BenchmarkRunner::FunctionExecutor {
#ifdef LLVM_ON_UNIX
// See "Exit Status for Commands":
// https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html
constexpr const int kSigOffset = 128;
constexpr int kSigOffset = 128;
return make_error<SnippetSignal>(CRC.RetCode - kSigOffset);
#else
// The exit code of the process on windows is not meaningful as a
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-exegesis/lib/BenchmarkRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class BenchmarkRunner {

// Scratch space to run instructions that touch memory.
struct ScratchSpace {
static constexpr const size_t kAlignment = 1024;
static constexpr const size_t kSize = 1 << 20; // 1MB.
static constexpr size_t kAlignment = 1024;
static constexpr size_t kSize = 1 << 20; // 1MB.
ScratchSpace()
: UnalignedPtr(std::make_unique<char[]>(kSize + kAlignment)),
AlignedPtr(
Expand Down
8 changes: 4 additions & 4 deletions llvm/tools/llvm-exegesis/lib/Clustering.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ class BenchmarkClustering {
ClusterId(size_t Id, bool IsUnstable = false)
: Id_(Id), IsUnstable_(IsUnstable) {}

static constexpr const size_t kMaxValid =
static constexpr size_t kMaxValid =
(std::numeric_limits<size_t>::max() >> 1) - 4;
static constexpr const size_t kNoise = kMaxValid + 1;
static constexpr const size_t kError = kMaxValid + 2;
static constexpr const size_t kUndef = kMaxValid + 3;
static constexpr size_t kNoise = kMaxValid + 1;
static constexpr size_t kError = kMaxValid + 2;
static constexpr size_t kUndef = kMaxValid + 3;

size_t Id_ : (std::numeric_limits<size_t>::digits - 1);
size_t IsUnstable_ : 1;
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-exegesis/lib/SubprocessMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace exegesis {

class SubprocessMemory {
public:
static constexpr const size_t AuxiliaryMemoryOffset = 1;
static constexpr const size_t AuxiliaryMemorySize = 4096;
static constexpr size_t AuxiliaryMemoryOffset = 1;
static constexpr size_t AuxiliaryMemorySize = 4096;

// Gets the thread ID for the calling thread.
static long getCurrentTID();
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-exegesis/lib/UopsBenchmarkRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class UopsBenchmarkRunner : public BenchmarkRunner {
ExecutionMode, ValCounters) {}
~UopsBenchmarkRunner() override;

static constexpr const size_t kMinNumDifferentAddresses = 6;
static constexpr size_t kMinNumDifferentAddresses = 6;

private:
Expected<std::vector<BenchmarkMeasure>>
Expand Down
14 changes: 7 additions & 7 deletions llvm/tools/llvm-exegesis/lib/X86/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ static Expected<std::vector<CodeTemplate>> generateLEATemplatesCommon(
assert(X86II::getMemoryOperandNo(Instr.Description.TSFlags) == 1 &&
"invalid LEA");

constexpr const int kDestOp = 0;
constexpr const int kBaseOp = 1;
constexpr const int kIndexOp = 3;
constexpr int kDestOp = 0;
constexpr int kBaseOp = 1;
constexpr int kIndexOp = 3;
auto PossibleDestRegs =
Instr.Operands[kDestOp].getRegisterAliasing().sourceBits();
remove(PossibleDestRegs, ForbiddenRegisters);
Expand Down Expand Up @@ -548,7 +548,7 @@ struct ConstantInliner {

void initStack(unsigned Bytes);

static constexpr const unsigned kF80Bytes = 10; // 80 bits.
static constexpr unsigned kF80Bytes = 10; // 80 bits.

APInt Constant_;
std::vector<MCInst> Instructions;
Expand Down Expand Up @@ -864,7 +864,7 @@ const MCPhysReg ExegesisX86Target::kUnavailableRegistersSSE[12] = {
// We're using one of R8-R15 because these registers are never hardcoded in
// instructions (e.g. MOVS writes to EDI, ESI, EDX), so they have less
// conflicts.
constexpr const MCPhysReg kDefaultLoopCounterReg = X86::R8;
constexpr MCPhysReg kDefaultLoopCounterReg = X86::R8;

} // namespace

Expand Down Expand Up @@ -1110,9 +1110,9 @@ std::vector<MCInst> ExegesisX86Target::setRegTo(const MCSubtargetInfo &STI,
#ifdef __linux__

#ifdef __arm__
static constexpr const uintptr_t VAddressSpaceCeiling = 0xC0000000;
static constexpr uintptr_t VAddressSpaceCeiling = 0xC0000000;
#else
static constexpr const uintptr_t VAddressSpaceCeiling = 0x0000800000000000;
static constexpr uintptr_t VAddressSpaceCeiling = 0x0000800000000000;
#endif

void generateRoundToNearestPage(unsigned int Register,
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using testing::IsEmpty;
using testing::Not;
using testing::NotNull;

constexpr const char kTriple[] = "aarch64-unknown-linux";
constexpr char kTriple[] = "aarch64-unknown-linux";

class AArch64TargetTest : public ::testing::Test {
protected:
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/tools/llvm-exegesis/PowerPC/TargetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using testing::NotNull;
using testing::IsEmpty;
using testing::Not;

constexpr const char kTriple[] = "powerpc64le-unknown-linux";
constexpr char kTriple[] = "powerpc64le-unknown-linux";

class PowerPCTargetTest : public PPCTestBase {
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class X86SnippetRepetitorTest : public X86TestBase {
Fill(Sink);
}

static constexpr const unsigned kMinInstructions = 3;
static constexpr const unsigned kLoopBodySize = 5;
static constexpr unsigned kMinInstructions = 3;
static constexpr unsigned kLoopBodySize = 5;

std::unique_ptr<TargetMachine> TM;
std::unique_ptr<LLVMContext> Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace exegesis {

// This needs to be updated anytime a test is added or removed from the test
// suite.
static constexpr const size_t TestCount = 4;
static constexpr size_t TestCount = 4;

class SubprocessMemoryTest : public X86TestBase {
protected:
Expand Down
8 changes: 4 additions & 4 deletions llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ TEST_F(X86Core2TargetTest, SetRegToDf0) {
TEST_F(X86Core2Avx512TargetTest, FillMemoryOperands_ADD64rm) {
const Instruction &I = getInstr(X86::ADD64rm);
InstructionTemplate IT(&I);
constexpr const int kOffset = 42;
constexpr int kOffset = 42;
State.getExegesisTarget().fillMemoryOperands(IT, X86::RDI, kOffset);
// Memory is operands 2-6.
EXPECT_THAT(IT.getValueFor(I.Operands[2]), IsReg(X86::RDI));
Expand All @@ -595,7 +595,7 @@ TEST_F(X86Core2Avx512TargetTest, FillMemoryOperands_ADD64rm) {
TEST_F(X86Core2Avx512TargetTest, FillMemoryOperands_VGATHERDPSZ128rm) {
const Instruction &I = getInstr(X86::VGATHERDPSZ128rm);
InstructionTemplate IT(&I);
constexpr const int kOffset = 42;
constexpr int kOffset = 42;
State.getExegesisTarget().fillMemoryOperands(IT, X86::RDI, kOffset);
// Memory is operands 4-8.
EXPECT_THAT(IT.getValueFor(I.Operands[4]), IsReg(X86::RDI));
Expand Down Expand Up @@ -625,9 +625,9 @@ TEST_F(X86Core2TargetTest, GenerateLowerMunmapTest) {
}

#ifdef __arm__
static constexpr const uintptr_t VAddressSpaceCeiling = 0xC0000000;
static constexpr uintptr_t VAddressSpaceCeiling = 0xC0000000;
#else
static constexpr const uintptr_t VAddressSpaceCeiling = 0x0000800000000000;
static constexpr uintptr_t VAddressSpaceCeiling = 0x0000800000000000;
#endif

TEST_F(X86Core2TargetTest, GenerateUpperMunmapTest) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/tools/llvm-exegesis/X86/TestBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace exegesis {

void InitializeX86ExegesisTarget();

constexpr const char kTriple[] = "x86_64-unknown-linux";
constexpr char kTriple[] = "x86_64-unknown-linux";

class X86TestBase : public ::testing::Test {
protected:
Expand Down