Skip to content

Commit 61146eb

Browse files
committed
Review comments
1 parent 4b255d8 commit 61146eb

File tree

5 files changed

+15
-24
lines changed

5 files changed

+15
-24
lines changed

llvm/include/llvm/CodeGen/TargetInstrInfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ struct ExtAddrMode {
113113
///
114114
class LLVM_ABI TargetInstrInfo : public MCInstrInfo {
115115
protected:
116-
/// Subtarget specific sub-array of MCInstrInfo's RegClassByHwModeTables.
117-
/// This should be indexed by MCOperandInfo's RegClass field for
118-
/// LookupRegClassByHwMode operands.
116+
/// Subtarget specific sub-array of MCInstrInfo's RegClassByHwModeTables
117+
/// (i.e. the table for the active HwMode). This should be indexed by
118+
/// MCOperandInfo's RegClass field for LookupRegClassByHwMode operands.
119119
const int16_t *const RegClassByHwMode;
120120

121121
public:
@@ -141,7 +141,7 @@ class LLVM_ABI TargetInstrInfo : public MCInstrInfo {
141141
Opc <= TargetOpcode::GENERIC_ATOMICRMW_OP_END;
142142
}
143143

144-
/// Return the subtarget appropripate RegClassID for \p OpInfo
144+
/// \returns the subtarget appropriate RegClassID for \p OpInfo
145145
///
146146
/// Note this shadows a version of getOpRegClassID in MCInstrInfo which takes
147147
/// an additional argument for the subtarget's HwMode, since TargetInstrInfo

llvm/include/llvm/MC/MCInstrDesc.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ class MCOperandInfo {
9191
/// index into a table in TargetInstrInfo or MCInstrInfo which contains the
9292
/// real register class ID.
9393
///
94-
/// If isLookupPtrRegClass is set, then this is / an index that is passed to
95-
/// TargetRegisterInfo::getPointerRegClass(x) to / get a dynamic register
96-
/// class.
94+
/// If isLookupPtrRegClass is set, then this is an index that is passed to
95+
/// TargetRegisterInfo::getPointerRegClass(x) to get a dynamic register class.
9796
int16_t RegClass;
9897

9998
/// These are flags from the MCOI::OperandFlags enum.

llvm/include/llvm/MC/MCInstrInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MCInstrInfo {
4444
unsigned NumOpcodes; // Number of entries in the desc array
4545

4646
protected:
47-
// Pointer to 2d array [NumHwModess][NumRegClassByHwModes]
47+
// Pointer to 2d array [NumHwModes][NumRegClassByHwModes]
4848
const int16_t *RegClassByHwModeTables;
4949
int16_t NumRegClassByHwModes;
5050

llvm/include/llvm/Target/Target.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class RegisterClassLike : DAGOperand;
271271
//
272272
class RegisterClass<string namespace, list<ValueType> regTypes, int alignment,
273273
dag regList, RegAltNameIndex idx = NoRegAltName>
274-
: DAGOperand, RegisterClassLike {
274+
: RegisterClassLike {
275275
string Namespace = namespace;
276276

277277
// The register size/alignment information, parameterized by a HW mode.
@@ -923,7 +923,7 @@ def decoder;
923923
/// type that it doesn't know, and resolves the actual regclass to use by using
924924
/// the TargetRegisterInfo::getPointerRegClass() hook at codegen time.
925925
///
926-
/// This is deprecated in favor of RegClassByHwMode
926+
/// This is deprecated in favor of RegClassByHwMode.
927927
class PointerLikeRegClass<int Kind> {
928928
int RegClassKind = Kind;
929929
}
@@ -936,8 +936,8 @@ class PointerLikeRegClass<int Kind> {
936936
/// define operands which swap the register class with the pointer
937937
/// type.
938938
class RegClassByHwMode<list<HwMode> Modes,
939-
list<RegisterClass> RegClasses> :
940-
HwModeSelect<Modes, !size(RegClasses)>, RegisterClassLike {
939+
list<RegisterClass> RegClasses>
940+
: HwModeSelect<Modes, !size(RegClasses)>, RegisterClassLike {
941941
list<RegisterClass> Objects = RegClasses;
942942
}
943943

llvm/utils/TableGen/AsmMatcherEmitter.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ struct ClassInfo {
167167
RegisterClass0,
168168

169169
/// The (first) register class by hwmode, subsequent register classes by
170-
/// hwmode are
171-
/// RegisterClassByHwMode0+1, and so on.
170+
/// hwmode are RegisterClassByHwMode0+1, and so on.
172171
RegisterClassByHwMode0 = 1 << 12,
173172

174173
/// The (first) user defined class, subsequent user defined classes are
@@ -178,7 +177,7 @@ struct ClassInfo {
178177

179178
/// Kind - The class kind, which is either a predefined kind, or (UserClass0 +
180179
/// N) for the Nth user defined class.
181-
unsigned Kind;
180+
unsigned Kind = 0;
182181

183182
/// SuperClasses - The super classes of this class. Note that for simplicities
184183
/// sake user operands only record their immediate super class, while register
@@ -220,7 +219,7 @@ struct ClassInfo {
220219
std::string DiagnosticString;
221220

222221
/// Is this operand optional and not always required.
223-
bool IsOptional;
222+
bool IsOptional = false;
224223

225224
/// DefaultMethod - The name of the method that returns the default operand
226225
/// for optional operand
@@ -1394,15 +1393,8 @@ void AsmMatcherInfo::buildRegisterClasses(
13941393
CI->ClassName = "RegByHwMode_" + ClassByHwMode->getName().str();
13951394
CI->Name = "MCK_" + CI->ClassName;
13961395
CI->ValueName = ClassByHwMode->getName();
1397-
CI->PredicateMethod = ""; // unused
13981396
CI->RenderMethod = "addRegOperands";
1399-
// CI->Registers = RS;
1400-
// FIXME: diagnostic type.
1401-
CI->DiagnosticType = "";
1402-
CI->IsOptional = false;
1403-
CI->DefaultMethod = ""; // unused
1404-
// RegisterSetClasses.try_emplace(RS, CI);
1405-
1397+
// FIXME: Set diagnostic type.
14061398
++RegClassByHwModeIndex;
14071399

14081400
assert(CI->isRegisterClassByHwMode());

0 commit comments

Comments
 (0)