================
@@ -263,17 +267,11 @@ class SVEEmitter {
   // which is inconvenient to specify in the arm_sve.td file or
   // generate in CGBuiltin.cpp.
   struct ReinterpretTypeInfo {
+    SVEType BaseType;
     const char *Suffix;
-    const char *Type;
-    const char *BuiltinType;
   };
-  SmallVector<ReinterpretTypeInfo, 12> Reinterprets = {
----------------
momchil-velikov wrote:

> Why you cannot do as you did before and only create an array for each size 
> _x2, _x3 and _x4?
> 
> I believe you've changed the class SVEType, so you could use SVEType 
> ToV(To.BaseType, N); and SVEType FromV(From.BaseType, N);. I am not sure we 
> should do that.
> 
> But I am not sure if the changes are worth.

Certainly I can go and create three more similar arrays. What advantage would 
that have over the current solution?

With the current approach we have less repetition and the details of encoding 
of type names and type specifications are kept in one place and reused; that 
means there's less chance for a manual error when I type, e.g.  `"q2UWi"`; also 
the code
will automatically adjust to adding new types or changing the encoding.

(FWIW even `{SVEType("s"), "s16"},` is too much, would define `enum class Type 
{ u8, s8, u16, s16, ... }` and have everything derived from these enumerators 
but there just should be a limit on the amount of refactoring in any single 
commit).


https://github.com/llvm/llvm-project/pull/69598
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to