[llvm] [Mips] Reduce number of selectVSplatUimm/Simm functions by using templates. (PR #116475)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 23:49:30 PST 2024


================
@@ -249,67 +249,67 @@ class SplatComplexPattern<Operand opclass, ValueType ty, int numops, string fn,
 }
 
 def vsplati8_uimm3 : SplatComplexPattern<vsplat_uimm3, v16i8, 1,
-                                         "selectVSplatUimm3",
+                                         "selectVSplatUimm<3>",
----------------
dtcxzyw wrote:

We can further reduce duplicate code with foreach:
```
foreach I = {2, 4, 5, 8} in
ef vsplati8_uimm # I : SplatComplexPattern<vsplat_uimm # I, v16i8, 1,
                                          "selectVSplatUimm<"# I #">",
```
Up to you.


https://github.com/llvm/llvm-project/pull/116475


More information about the llvm-commits mailing list