llvm.org GIT mirror llvm / ca89139
Declare MVT::SimpleValueType as an int8_t sized enum. This removes 400 bytes from TargetLoweringBase and probably other places. This required changing several places to print VT enums as strings instead of raw ints since the proper method to use to print became ambiguous. This is probably an improvement anyway. This also appears to save ~8K from an x86 self host build of llc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266562 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 4 years ago
7 changed file(s) with 26 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
2727 /// type can be represented by an MVT.
2828 class MVT {
2929 public:
30 enum SimpleValueType {
30 enum SimpleValueType : int8_t {
3131 // INVALID_SIMPLE_VALUE_TYPE - Simple value types less than zero are
3232 // considered extended value types.
3333 INVALID_SIMPLE_VALUE_TYPE = -1,
141141 MAX_ALLOWED_VALUETYPE = 96,
142142
143143 // Token - A value of type llvm::TokenTy
144 token = 249,
144 token = 120,
145145
146146 // Metadata - This is MDNode or MDString.
147 Metadata = 250,
147 Metadata = 121,
148148
149149 // iPTRAny - An int value the size of the pointer of the current
150150 // target to any address space. This must only be used internal to
151151 // tblgen. Other than for overloading, we treat iPTRAny the same as iPTR.
152 iPTRAny = 251,
152 iPTRAny = 122,
153153
154154 // vAny - A vector with any length and element size. This is used
155155 // for intrinsics that have overloadings based on vector types.
156156 // This is only for tblgen's consumption!
157 vAny = 252,
157 vAny = 123,
158158
159159 // fAny - Any floating-point or vector floating-point value. This is used
160160 // for intrinsics that have overloadings based on floating-point types.
161161 // This is only for tblgen's consumption!
162 fAny = 253,
162 fAny = 124,
163163
164164 // iAny - An integer or vector integer value of any bit width. This is
165165 // used for intrinsics that have overloadings based on integer bit widths.
166166 // This is only for tblgen's consumption!
167 iAny = 254,
167 iAny = 125,
168168
169169 // iPTR - An int value the size of the pointer of the current
170170 // target. This should only be used internal to tblgen!
171 iPTR = 255,
171 iPTR = 126,
172172
173173 // Any - Any type. This is used for intrinsics that have overloadings.
174174 // This is only for tblgen's consumption!
175 Any = 256
175 Any = 127
176176 };
177177
178178 SimpleValueType SimpleTy;
9595 def FlagVT : ValueType<0 , 65>; // Pre-RA sched glue
9696 def isVoid : ValueType<0 , 66>; // Produces no value
9797 def untyped: ValueType<8 , 67>; // Produces an untyped value
98 def token : ValueType<0 , 249>; // TokenTy
99 def MetadataVT: ValueType<0, 250>; // Metadata
98 def token : ValueType<0 , 120>; // TokenTy
99 def MetadataVT: ValueType<0, 121>; // Metadata
100100
101101 // Pseudo valuetype mapped to the current pointer size to any address space.
102102 // Should only be used in TableGen.
103 def iPTRAny : ValueType<0, 251>;
103 def iPTRAny : ValueType<0, 122>;
104104
105105 // Pseudo valuetype to represent "vector of any size"
106 def vAny : ValueType<0 , 252>;
106 def vAny : ValueType<0 , 123>;
107107
108108 // Pseudo valuetype to represent "float of any format"
109 def fAny : ValueType<0 , 253>;
109 def fAny : ValueType<0 , 124>;
110110
111111 // Pseudo valuetype to represent "integer of any bit width"
112 def iAny : ValueType<0 , 254>;
112 def iAny : ValueType<0 , 125>;
113113
114114 // Pseudo valuetype mapped to the current pointer size.
115 def iPTR : ValueType<0 , 255>;
115 def iPTR : ValueType<0 , 126>;
116116
117117 // Pseudo valuetype to represent "any type of any size".
118 def Any : ValueType<0 , 256>;
118 def Any : ValueType<0 , 127>;
174174 switch (RegVT.getSimpleVT().SimpleTy) {
175175 default: {
176176 errs() << "LowerFormalArguments Unhandled argument type: "
177 << RegVT.getSimpleVT().SimpleTy << '\n';
177 << RegVT.getEVTString() << '\n';
178178 llvm_unreachable(0);
179179 }
180180 case MVT::i64:
454454 {
455455 #ifndef NDEBUG
456456 errs() << "LowerFormalArguments Unhandled argument type: "
457 << RegVT.getSimpleVT().SimpleTy << "\n";
457 << RegVT.getEVTString() << "\n";
458458 #endif
459459 llvm_unreachable(nullptr);
460460 }
13311331 {
13321332 #ifndef NDEBUG
13331333 errs() << "LowerFormalArguments Unhandled argument type: "
1334 << RegVT.getSimpleVT().SimpleTy << "\n";
1334 << RegVT.getEVTString() << "\n";
13351335 #endif
13361336 llvm_unreachable(nullptr);
13371337 }
2121 list IntrProperties = [];
2222 }
2323
24 def iAny : ValueType<0, 254>;
24 def iAny : ValueType<0, 125>;
2525 def llvm_anyint_ty : LLVMType;
2626
2727 // Make sure we generate the long name without crashing
224224 }
225225
226226 void EmitIntegerMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
227 OS.indent(indent) << "EmitInteger " << Val << " VT=" << VT << '\n';
227 OS.indent(indent) << "EmitInteger " << Val << " VT=" << getEnumName(VT)
228 << '\n';
228229 }
229230
230231 void EmitStringIntegerMatcher::
231232 printImpl(raw_ostream &OS, unsigned indent) const {
232 OS.indent(indent) << "EmitStringInteger " << Val << " VT=" << VT << '\n';
233 OS.indent(indent) << "EmitStringInteger " << Val << " VT=" << getEnumName(VT)
234 << '\n';
233235 }
234236
235237 void EmitRegisterMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
238240 OS << Reg->getName();
239241 else
240242 OS << "zero_reg";
241 OS << " VT=" << VT << '\n';
243 OS << " VT=" << getEnumName(VT) << '\n';
242244 }
243245
244246 void EmitConvertToTargetMatcher::