[PATCH] D144531: [RISCV] Replaced !subst chain with !foldl

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 19:17:25 PST 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:51
 class PseudoToVInst<string PseudoInst> {
-  string VInst = !subst("_M8", "",
-                 !subst("_M4", "",
-                 !subst("_M2", "",
-                 !subst("_M1", "",
-                 !subst("_MF2", "",
-                 !subst("_MF4", "",
-                 !subst("_MF8", "",
-                 !subst("_B1", "",
-                 !subst("_B2", "",
-                 !subst("_B4", "",
-                 !subst("_B8", "",
-                 !subst("_B16", "",
-                 !subst("_B32", "",
-                 !subst("_B64", "",
-                 !subst("_MASK", "",
-                 !subst("_TIED", "",
-                 !subst("_TU", "",
-                 !subst("F16", "F",
-                 !subst("F32", "F",
-                 !subst("F64", "F",
-                 !subst("Pseudo", "", PseudoInst)))))))))))))))))))));
+  defvar AffixSubsts = [["Pseudo", ""],
+                        ["F64", "F"],
----------------
For everyone else, I discussed this with Nitin internally. The list here is in reverse order because the original list was applied from the inside out. So "Pseudo" was substituted first. The order almost doesn't matter except that "_B16" must be replaced before "_B1" since "_B1" is a prefix of "_B16"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144531/new/

https://reviews.llvm.org/D144531



More information about the llvm-commits mailing list