Skip to content

[CodeGen] Rename MVT::iPTRAny to MVT::pAny #113733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 30, 2024
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
3 changes: 2 additions & 1 deletion llvm/include/llvm/CodeGen/ValueTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ namespace llvm {

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

/// Return true if the bit size is a multiple of 8.
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/ValueTypes.td
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ def MetadataVT : ValueType<0, 505> { // Metadata
let LLVMName = "Metadata";
}

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

// Pseudo valuetype to represent "vector of any size"
// Should only be used in TableGen.
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGenTypes/MachineValueType.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ namespace llvm {
llvm_unreachable("Value type is non-standard value, Other.");
case iPTR:
llvm_unreachable("Value type size is target-dependent. Ask TLI.");
case iPTRAny:
case pAny:
case iAny:
case fAny:
case vAny:
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/Intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace Intrinsic {
/// return the existing declaration.
///
/// The \p Tys parameter is for intrinsics with overloaded types (e.g., those
/// using iAny, fAny, vAny, or iPTRAny). For a declaration of an overloaded
/// using iAny, fAny, vAny, or pAny). For a declaration of an overloaded
/// intrinsic, Tys must provide exactly one type for each overloaded type in
/// the intrinsic.
Function *getOrInsertDeclaration(Module *M, ID id, ArrayRef<Type *> Tys = {});
Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/IR/Intrinsics.td
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class LLVMAnyType<ValueType vt> : LLVMType<vt> {
!eq(vt, iAny) : ArgKind.AnyInteger,
!eq(vt, fAny) : ArgKind.AnyFloat,
!eq(vt, vAny) : ArgKind.AnyVector,
!eq(vt, iPTRAny) : ArgKind.AnyPointer,
!eq(vt, pAny) : ArgKind.AnyPointer,
);
let Sig = [
IIT_ARG.Number,
Expand All @@ -412,8 +412,8 @@ class LLVMQualPointerType<int addrspace>
]);
}

class LLVMAnyPointerType : LLVMAnyType<iPTRAny> {
assert isAny, "iPTRAny should have isOverloaded";
class LLVMAnyPointerType : LLVMAnyType<pAny> {
assert isAny, "pAny should have isOverloaded";
}

// Match the type of another intrinsic parameter. Number is an index into the
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ def imem : Operand<iPTR> {
let PrintMethod = "printOperand";
}

def imemAny : Operand<iPTRAny> {
def imemAny : Operand<pAny> {
let PrintMethod = "printOperand";
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,8 @@ void TypeInfer::expandOverloads(TypeSetByHwMode &VTS) const {

void TypeInfer::expandOverloads(TypeSetByHwMode::SetType &Out,
const TypeSetByHwMode::SetType &Legal) const {
if (Out.count(MVT::iPTRAny)) {
Out.erase(MVT::iPTRAny);
if (Out.count(MVT::pAny)) {
Out.erase(MVT::pAny);
Out.insert(MVT::iPTR);
} else if (Out.count(MVT::iAny)) {
Out.erase(MVT::iAny);
Expand Down
2 changes: 1 addition & 1 deletion mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static IndicesTy getOverloadableTypeIdxs(const Record &record,
case llvm::MVT::iAny:
case llvm::MVT::fAny:
case llvm::MVT::Any:
case llvm::MVT::iPTRAny:
case llvm::MVT::pAny:
case llvm::MVT::vAny:
overloadedOps.set(r.index());
break;
Expand Down
Loading