Skip to content

Commit 24923b7

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.4
2 parents 59b6c1b + 3b927fa commit 24923b7

File tree

11 files changed

+24
-37
lines changed

11 files changed

+24
-37
lines changed

llvm/include/llvm/CodeGen/ValueTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ namespace llvm {
230230

231231
/// Return true if this is an overloaded type for TableGen.
232232
bool isOverloaded() const {
233-
return (V==MVT::iAny || V==MVT::fAny || V==MVT::vAny || V==MVT::iPTRAny);
233+
return (V==MVT::iAny || V==MVT::fAny || V==MVT::vAny || V==MVT::pAny);
234234
}
235235

236236
/// Return true if the bit size is a multiple of 8.

llvm/include/llvm/CodeGen/ValueTypes.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ def MetadataVT : ValueType<0, 505> { // Metadata
338338
let LLVMName = "Metadata";
339339
}
340340

341-
// Pseudo valuetype mapped to the current pointer size to any address space.
341+
// Pseudo valuetype to represent "pointer to any address space"
342342
// Should only be used in TableGen.
343-
def iPTRAny : VTAny<506>;
343+
def pAny : VTAny<506>;
344344

345345
// Pseudo valuetype to represent "vector of any size"
346346
// Should only be used in TableGen.

llvm/include/llvm/CodeGenTypes/MachineValueType.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ namespace llvm {
320320
llvm_unreachable("Value type is non-standard value, Other.");
321321
case iPTR:
322322
llvm_unreachable("Value type size is target-dependent. Ask TLI.");
323-
case iPTRAny:
323+
case pAny:
324324
case iAny:
325325
case fAny:
326326
case vAny:

llvm/include/llvm/IR/Intrinsics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ namespace Intrinsic {
9292
/// return the existing declaration.
9393
///
9494
/// The \p Tys parameter is for intrinsics with overloaded types (e.g., those
95-
/// using iAny, fAny, vAny, or iPTRAny). For a declaration of an overloaded
95+
/// using iAny, fAny, vAny, or pAny). For a declaration of an overloaded
9696
/// intrinsic, Tys must provide exactly one type for each overloaded type in
9797
/// the intrinsic.
9898
Function *getOrInsertDeclaration(Module *M, ID id, ArrayRef<Type *> Tys = {});

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class LLVMAnyType<ValueType vt> : LLVMType<vt> {
388388
!eq(vt, iAny) : ArgKind.AnyInteger,
389389
!eq(vt, fAny) : ArgKind.AnyFloat,
390390
!eq(vt, vAny) : ArgKind.AnyVector,
391-
!eq(vt, iPTRAny) : ArgKind.AnyPointer,
391+
!eq(vt, pAny) : ArgKind.AnyPointer,
392392
);
393393
let Sig = [
394394
IIT_ARG.Number,
@@ -412,8 +412,8 @@ class LLVMQualPointerType<int addrspace>
412412
]);
413413
}
414414

415-
class LLVMAnyPointerType : LLVMAnyType<iPTRAny> {
416-
assert isAny, "iPTRAny should have isOverloaded";
415+
class LLVMAnyPointerType : LLVMAnyType<pAny> {
416+
assert isAny, "pAny should have isOverloaded";
417417
}
418418

419419
// Match the type of another intrinsic parameter. Number is an index into the

llvm/lib/Target/NVPTX/NVPTXInstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ def imem : Operand<iPTR> {
19221922
let PrintMethod = "printOperand";
19231923
}
19241924

1925-
def imemAny : Operand<iPTRAny> {
1925+
def imemAny : Operand<pAny> {
19261926
let PrintMethod = "printOperand";
19271927
}
19281928

llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,8 @@ void TypeInfer::expandOverloads(TypeSetByHwMode &VTS) const {
813813

814814
void TypeInfer::expandOverloads(TypeSetByHwMode::SetType &Out,
815815
const TypeSetByHwMode::SetType &Legal) const {
816-
if (Out.count(MVT::iPTRAny)) {
817-
Out.erase(MVT::iPTRAny);
816+
if (Out.count(MVT::pAny)) {
817+
Out.erase(MVT::pAny);
818818
Out.insert(MVT::iPTR);
819819
} else if (Out.count(MVT::iAny)) {
820820
Out.erase(MVT::iAny);
@@ -2461,7 +2461,8 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
24612461
ValueTypeByHwMode VVT = TP.getInfer().getConcrete(Types[0], false);
24622462
for (auto &P : VVT) {
24632463
MVT::SimpleValueType VT = P.second.SimpleTy;
2464-
if (VT == MVT::iPTR || VT == MVT::iPTRAny)
2464+
// Can only check for types of a known size
2465+
if (VT == MVT::iPTR)
24652466
continue;
24662467
unsigned Size = MVT(VT).getFixedSizeInBits();
24672468
// Make sure that the value is representable for this type.

llvm/utils/TableGen/Common/CodeGenTarget.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,6 @@ MVT::SimpleValueType llvm::getValueType(const Record *Rec) {
4747
return (MVT::SimpleValueType)Rec->getValueAsInt("Value");
4848
}
4949

50-
StringRef llvm::getName(MVT::SimpleValueType T) {
51-
switch (T) {
52-
case MVT::Other:
53-
return "UNKNOWN";
54-
case MVT::iPTR:
55-
return "TLI.getPointerTy()";
56-
case MVT::iPTRAny:
57-
return "TLI.getPointerTy()";
58-
default:
59-
return getEnumName(T);
60-
}
61-
}
62-
6350
StringRef llvm::getEnumName(MVT::SimpleValueType T) {
6451
// clang-format off
6552
switch (T) {

llvm/utils/TableGen/Common/CodeGenTarget.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class CodeGenSubRegIndex;
4646
/// record corresponds to.
4747
MVT::SimpleValueType getValueType(const Record *Rec);
4848

49-
StringRef getName(MVT::SimpleValueType T);
5049
StringRef getEnumName(MVT::SimpleValueType T);
5150

5251
/// getQualifiedName - Return the name of the specified record, with a

llvm/utils/TableGen/FastISelEmitter.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -718,19 +718,19 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) {
718718
const PredMap &PM = RI.second;
719719

720720
OS << "unsigned fastEmit_" << getLegalCName(Opcode) << "_"
721-
<< getLegalCName(std::string(getName(VT))) << "_"
722-
<< getLegalCName(std::string(getName(RetVT))) << "_";
721+
<< getLegalCName(std::string(getEnumName(VT))) << "_"
722+
<< getLegalCName(std::string(getEnumName(RetVT))) << "_";
723723
Operands.PrintManglingSuffix(OS, ImmediatePredicates);
724724
OS << "(";
725725
Operands.PrintParameters(OS);
726726
OS << ") {\n";
727727

728-
emitInstructionCode(OS, Operands, PM, std::string(getName(RetVT)));
728+
emitInstructionCode(OS, Operands, PM, std::string(getEnumName(RetVT)));
729729
}
730730

731731
// Emit one function for the type that demultiplexes on return type.
732732
OS << "unsigned fastEmit_" << getLegalCName(Opcode) << "_"
733-
<< getLegalCName(std::string(getName(VT))) << "_";
733+
<< getLegalCName(std::string(getEnumName(VT))) << "_";
734734
Operands.PrintManglingSuffix(OS, ImmediatePredicates);
735735
OS << "(MVT RetVT";
736736
if (!Operands.empty())
@@ -739,10 +739,10 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) {
739739
OS << ") {\nswitch (RetVT.SimpleTy) {\n";
740740
for (const auto &RI : RM) {
741741
MVT::SimpleValueType RetVT = RI.first;
742-
OS << " case " << getName(RetVT) << ": return fastEmit_"
742+
OS << " case " << getEnumName(RetVT) << ": return fastEmit_"
743743
<< getLegalCName(Opcode) << "_"
744-
<< getLegalCName(std::string(getName(VT))) << "_"
745-
<< getLegalCName(std::string(getName(RetVT))) << "_";
744+
<< getLegalCName(std::string(getEnumName(VT))) << "_"
745+
<< getLegalCName(std::string(getEnumName(RetVT))) << "_";
746746
Operands.PrintManglingSuffix(OS, ImmediatePredicates);
747747
OS << "(";
748748
Operands.PrintArguments(OS);
@@ -753,15 +753,15 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) {
753753
} else {
754754
// Non-variadic return type.
755755
OS << "unsigned fastEmit_" << getLegalCName(Opcode) << "_"
756-
<< getLegalCName(std::string(getName(VT))) << "_";
756+
<< getLegalCName(std::string(getEnumName(VT))) << "_";
757757
Operands.PrintManglingSuffix(OS, ImmediatePredicates);
758758
OS << "(MVT RetVT";
759759
if (!Operands.empty())
760760
OS << ", ";
761761
Operands.PrintParameters(OS);
762762
OS << ") {\n";
763763

764-
OS << " if (RetVT.SimpleTy != " << getName(RM.begin()->first)
764+
OS << " if (RetVT.SimpleTy != " << getEnumName(RM.begin()->first)
765765
<< ")\n return 0;\n";
766766

767767
const PredMap &PM = RM.begin()->second;
@@ -781,7 +781,7 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) {
781781
OS << " switch (VT.SimpleTy) {\n";
782782
for (const auto &TI : TM) {
783783
MVT::SimpleValueType VT = TI.first;
784-
std::string TypeName = std::string(getName(VT));
784+
std::string TypeName = std::string(getEnumName(VT));
785785
OS << " case " << TypeName << ": return fastEmit_"
786786
<< getLegalCName(Opcode) << "_" << getLegalCName(TypeName) << "_";
787787
Operands.PrintManglingSuffix(OS, ImmediatePredicates);

0 commit comments

Comments
 (0)