From: NAKAMURA Takumi Date: Wed, 8 Mar 2023 15:37:00 +0000 (+0900) Subject: ValueTypes.td: Introduce VTAny as `isOverloaded = true` X-Git-Tag: upstream/17.0.6~10549 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c853c845ad6ff1591f60a909fa3c7d293c27b49;p=platform%2Fupstream%2Fllvm.git ValueTypes.td: Introduce VTAny as `isOverloaded = true` `ValueType.isOverloaded` is used for; - Define `iPTRAny`, `vAny`, `fAny`, and `Any` - Reflect `ValueType.isOverloaded` to `LLVMType.isAny` in `Intrinsics.td` - (Planninig) Reflect the condition to `MVT::isOverloaded()` Part of D146179 --- diff --git a/llvm/include/llvm/CodeGen/ValueTypes.td b/llvm/include/llvm/CodeGen/ValueTypes.td index 336b2a49b131..7b683129ece9 100644 --- a/llvm/include/llvm/CodeGen/ValueTypes.td +++ b/llvm/include/llvm/CodeGen/ValueTypes.td @@ -16,6 +16,11 @@ class ValueType { string Namespace = "MVT"; int Size = size; int Value = value; + int isOverloaded = false; +} + +class VTAny : ValueType<0, value> { + let isOverloaded = true; } def OtherVT : ValueType<0, 1>; // "Other" value @@ -245,22 +250,22 @@ def MetadataVT : ValueType<0, 249>; // Metadata // Pseudo valuetype mapped to the current pointer size to any address space. // Should only be used in TableGen. -def iPTRAny : ValueType<0, 250>; +def iPTRAny : VTAny<250>; // Pseudo valuetype to represent "vector of any size" -def vAny : ValueType<0, 251>; +def vAny : VTAny<251>; // Pseudo valuetype to represent "float of any format" -def fAny : ValueType<0, 252>; +def fAny : VTAny<252>; // Pseudo valuetype to represent "integer of any bit width" -def iAny : ValueType<0, 253>; +def iAny : VTAny<253>; // Pseudo valuetype mapped to the current pointer size. def iPTR : ValueType<0, 254>; // Pseudo valuetype to represent "any type of any size". -def Any : ValueType<0, 255>; +def Any : VTAny<255>; /// This class is for targets that want to use pointer types in patterns /// with the GlobalISelEmitter. Targets must define their own pointer diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td index 2b9436d326b7..48372362fdbf 100644 --- a/llvm/include/llvm/IR/Intrinsics.td +++ b/llvm/include/llvm/IR/Intrinsics.td @@ -188,7 +188,7 @@ def ArgKind { class LLVMType { ValueType VT = vt; - int isAny = false; + int isAny = vt.isOverloaded; } class LLVMQualPointerType @@ -204,7 +204,7 @@ class LLVMAnyPointerType : LLVMType{ LLVMType ElTy = elty; - let isAny = true; + assert isAny, "iPTRAny should have isOverloaded"; } // Match the type of another intrinsic parameter. Number is an index into the @@ -254,12 +254,12 @@ class LLVMSubdivide4VectorType : LLVMMatchType; class LLVMVectorOfBitcastsToInt : LLVMMatchType; def llvm_void_ty : LLVMType; -let isAny = true in { - def llvm_any_ty : LLVMType; - def llvm_anyint_ty : LLVMType; - def llvm_anyfloat_ty : LLVMType; - def llvm_anyvector_ty : LLVMType; -} + +def llvm_any_ty : LLVMType; +def llvm_anyint_ty : LLVMType; +def llvm_anyfloat_ty : LLVMType; +def llvm_anyvector_ty : LLVMType; + def llvm_i1_ty : LLVMType; def llvm_i8_ty : LLVMType; def llvm_i16_ty : LLVMType;