[llvm] aeafdc2 - [AMDGPU] Use using instead of typedef. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 08:44:34 PDT 2024
Author: Jay Foad
Date: 2024-07-16T16:44:12+01:00
New Revision: aeafdc21d29793fdb6bfb19b919ea3ad56226cf4
URL: https://github.com/llvm/llvm-project/commit/aeafdc21d29793fdb6bfb19b919ea3ad56226cf4
DIFF: https://github.com/llvm/llvm-project/commit/aeafdc21d29793fdb6bfb19b919ea3ad56226cf4.diff
LOG: [AMDGPU] Use using instead of typedef. NFC.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
llvm/lib/Target/AMDGPU/GCNILPSched.cpp
llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp
llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp
llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
index 7a256cf8a9832..74e67690d5e88 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
@@ -112,7 +112,7 @@ class InstructionRule {
virtual ~InstructionRule() = default;
};
-typedef DenseMap<SUnit *, SmallVector<int, 4>> SUnitsToCandidateSGsMap;
+using SUnitsToCandidateSGsMap = DenseMap<SUnit *, SmallVector<int, 4>>;
// Classify instructions into groups to enable fine tuned control over the
// scheduler. These groups may be more specific than current SchedModel
@@ -261,8 +261,8 @@ static void resetEdges(SUnit &SU, ScheduleDAGInstrs *DAG) {
S.getSUnit()->removePred(SP);
}
-typedef std::pair<SUnit *, SmallVector<int, 4>> SUToCandSGsPair;
-typedef SmallVector<SUToCandSGsPair, 4> SUsToCandSGsVec;
+using SUToCandSGsPair = std::pair<SUnit *, SmallVector<int, 4>>;
+using SUsToCandSGsVec = SmallVector<SUToCandSGsPair, 4>;
// The PipelineSolver is used to assign SUnits to SchedGroups in a pipeline
// in non-trivial cases. For example, if the requested pipeline is
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
index 2491b605693f1..fd3186332c629 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
@@ -55,7 +55,7 @@ class AMDGPULibCalls {
AssumptionCache *AC = nullptr;
DominatorTree *DT = nullptr;
- typedef llvm::AMDGPULibFunc FuncInfo;
+ using FuncInfo = llvm::AMDGPULibFunc;
bool UnsafeFPMath = false;
diff --git a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
index 4fd9ed2a89279..a402fc6d7e611 100644
--- a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
@@ -446,10 +446,10 @@ void GCNHazardRecognizer::RecedeCycle() {
// Helper Functions
//===----------------------------------------------------------------------===//
-typedef enum { HazardFound, HazardExpired, NoHazardFound } HazardFnResult;
+using HazardFnResult = enum { HazardFound, HazardExpired, NoHazardFound };
-typedef function_ref<bool(const MachineInstr &, int WaitStates)> IsExpiredFn;
-typedef function_ref<unsigned int(const MachineInstr &)> GetNumWaitStatesFn;
+using IsExpiredFn = function_ref<bool(const MachineInstr &, int WaitStates)>;
+using GetNumWaitStatesFn = function_ref<unsigned int(const MachineInstr &)>;
// Search for a hazard in a block and its predecessors.
template <typename StateT>
diff --git a/llvm/lib/Target/AMDGPU/GCNILPSched.cpp b/llvm/lib/Target/AMDGPU/GCNILPSched.cpp
index 559dd0ed0c413..b1d51092ab9b7 100644
--- a/llvm/lib/Target/AMDGPU/GCNILPSched.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNILPSched.cpp
@@ -27,7 +27,7 @@ class GCNILPScheduler {
};
SpecificBumpPtrAllocator<Candidate> Alloc;
- typedef simple_ilist<Candidate> Queue;
+ using Queue = simple_ilist<Candidate>;
Queue PendingQueue;
Queue AvailQueue;
unsigned CurQueueId = 0;
diff --git a/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp b/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp
index 90dbbf407d3dd..d6395fd75924d 100644
--- a/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp
@@ -56,13 +56,13 @@ class GCNNSAReassign : public MachineFunctionPass {
}
private:
- typedef enum {
+ using NSA_Status = enum {
NOT_NSA, // Not an NSA instruction
FIXED, // NSA which we cannot modify
NON_CONTIGUOUS, // NSA with non-sequential address which we can try
// to optimize.
CONTIGUOUS // NSA with all sequential address registers
- } NSA_Status;
+ };
const GCNSubtarget *ST;
diff --git a/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp b/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp
index 6f83804f0a6f4..90169b1cb3df9 100644
--- a/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp
@@ -88,7 +88,7 @@ class GCNRewritePartialRegUses : public MachineFunctionPass {
};
/// Map OldSubReg -> { RC, NewSubReg }. Used as in/out container.
- typedef SmallDenseMap<unsigned, SubRegInfo> SubRegMap;
+ using SubRegMap = SmallDenseMap<unsigned, SubRegInfo>;
/// Given register class RC and the set of used subregs as keys in the SubRegs
/// map return new register class and indexes of right-shifted subregs as
diff --git a/llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp b/llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp
index 70ea5b8916155..0d3a221970bf8 100644
--- a/llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp
@@ -32,7 +32,7 @@ MaxClause("amdgpu-max-memory-clause", cl::Hidden, cl::init(15),
namespace {
class SIFormMemoryClauses : public MachineFunctionPass {
- typedef DenseMap<unsigned, std::pair<unsigned, LaneBitmask>> RegUse;
+ using RegUse = DenseMap<unsigned, std::pair<unsigned, LaneBitmask>>;
public:
static char ID;
More information about the llvm-commits
mailing list